summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorydah <[email protected]>2024-11-27 19:18:58 +0900
committergit <[email protected]>2024-12-02 18:41:38 +0000
commit2ba598726360226b5a00d7c72a62479c6eb0e87a (patch)
tree2985d58e9a1f24178aafcbfc26b7fcd28183921f /test
parentaa77bfd13ee183adde6bdc7812cfbb9580ea4b7a (diff)
[ruby/prism] Reject invalid dot method call after match predicate or after match required
Partially fixes: https://github.com/ruby/prism/issues/3171 https://github.com/ruby/prism/commit/5c33fa5a1a
Diffstat (limited to 'test')
-rw-r--r--test/prism/errors/match_predicate_after_and_with_dot_method_call.txt3
-rw-r--r--test/prism/errors/match_predicate_after_or_with_dot_method_call.txt3
-rw-r--r--test/prism/errors/match_predicate_after_rescue_with_dot_method_call.txt3
-rw-r--r--test/prism/errors/match_required_after_and_with_dot_method_call.txt3
-rw-r--r--test/prism/errors/match_required_after_or_with_dot_method_call.txt3
-rw-r--r--test/prism/errors/match_required_after_rescue_with_dot_method_call.txt3
6 files changed, 18 insertions, 0 deletions
diff --git a/test/prism/errors/match_predicate_after_and_with_dot_method_call.txt b/test/prism/errors/match_predicate_after_and_with_dot_method_call.txt
new file mode 100644
index 0000000000..32b77d127c
--- /dev/null
+++ b/test/prism/errors/match_predicate_after_and_with_dot_method_call.txt
@@ -0,0 +1,3 @@
+1 and 2 in 3.inspect
+ ^ unexpected '.', expecting end-of-input
+
diff --git a/test/prism/errors/match_predicate_after_or_with_dot_method_call.txt b/test/prism/errors/match_predicate_after_or_with_dot_method_call.txt
new file mode 100644
index 0000000000..0a940166dc
--- /dev/null
+++ b/test/prism/errors/match_predicate_after_or_with_dot_method_call.txt
@@ -0,0 +1,3 @@
+'a' or 1 in 1.upcase
+ ^ unexpected '.', expecting end-of-input
+
diff --git a/test/prism/errors/match_predicate_after_rescue_with_dot_method_call.txt b/test/prism/errors/match_predicate_after_rescue_with_dot_method_call.txt
new file mode 100644
index 0000000000..fead8aaf23
--- /dev/null
+++ b/test/prism/errors/match_predicate_after_rescue_with_dot_method_call.txt
@@ -0,0 +1,3 @@
+'a' rescue 2 in 3.upcase
+ ^ unexpected '.', expecting end-of-input
+
diff --git a/test/prism/errors/match_required_after_and_with_dot_method_call.txt b/test/prism/errors/match_required_after_and_with_dot_method_call.txt
new file mode 100644
index 0000000000..0ecf86bae1
--- /dev/null
+++ b/test/prism/errors/match_required_after_and_with_dot_method_call.txt
@@ -0,0 +1,3 @@
+1 and 2 => 3.inspect
+ ^ unexpected '.', expecting end-of-input
+
diff --git a/test/prism/errors/match_required_after_or_with_dot_method_call.txt b/test/prism/errors/match_required_after_or_with_dot_method_call.txt
new file mode 100644
index 0000000000..479413250d
--- /dev/null
+++ b/test/prism/errors/match_required_after_or_with_dot_method_call.txt
@@ -0,0 +1,3 @@
+1 or 2 => 3.inspect
+ ^ unexpected '.', expecting end-of-input
+
diff --git a/test/prism/errors/match_required_after_rescue_with_dot_method_call.txt b/test/prism/errors/match_required_after_rescue_with_dot_method_call.txt
new file mode 100644
index 0000000000..d72d72ce60
--- /dev/null
+++ b/test/prism/errors/match_required_after_rescue_with_dot_method_call.txt
@@ -0,0 +1,3 @@
+1 rescue 2 => 3.inspect
+ ^ unexpected '.', expecting end-of-input
+