From 6d56108674ed167fef26030d36892f7c6113a820 Mon Sep 17 00:00:00 2001 From: Soutaro Matsumoto Date: Thu, 25 Jul 2024 16:09:17 +0900 Subject: [PATCH] Add `Symbol#=~` test with Steep --- test/typecheck/symbol_match/Steepfile | 7 +++++++ test/typecheck/symbol_match/a.rbs | 3 +++ test/typecheck/symbol_match/match.rb | 3 +++ 3 files changed, 13 insertions(+) create mode 100644 test/typecheck/symbol_match/Steepfile create mode 100644 test/typecheck/symbol_match/a.rbs create mode 100644 test/typecheck/symbol_match/match.rb diff --git a/test/typecheck/symbol_match/Steepfile b/test/typecheck/symbol_match/Steepfile new file mode 100644 index 000000000..77b233465 --- /dev/null +++ b/test/typecheck/symbol_match/Steepfile @@ -0,0 +1,7 @@ +D = Steep::Diagnostic + +target :test do + signature "." + check "." + configure_code_diagnostics(D::Ruby.all_error) +end diff --git a/test/typecheck/symbol_match/a.rbs b/test/typecheck/symbol_match/a.rbs new file mode 100644 index 000000000..b5017f712 --- /dev/null +++ b/test/typecheck/symbol_match/a.rbs @@ -0,0 +1,3 @@ +class CustomMatcher + def =~: (String) -> bool +end diff --git a/test/typecheck/symbol_match/match.rb b/test/typecheck/symbol_match/match.rb new file mode 100644 index 000000000..1f360bf80 --- /dev/null +++ b/test/typecheck/symbol_match/match.rb @@ -0,0 +1,3 @@ +a = (:foo =~ /a/) #: Integer? + +b = (:foo =~ CustomMatcher.new) #: bool