summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorydah <[email protected]>2024-11-27 19:31:29 +0900
committergit <[email protected]>2024-12-02 18:42:16 +0000
commitfd217d475d885d02e526deef644d552cdec28b13 (patch)
tree6e661bc2d4a5c7a5c7fd7d6104fda2c1c9ff9dd3 /test
parent2ba598726360226b5a00d7c72a62479c6eb0e87a (diff)
[ruby/prism] Reject invalid operator after match predicate or after match required
Partially fixes: #3171 https://github.com/ruby/prism/commit/d0d9699c27
Diffstat (limited to 'test')
-rw-r--r--test/prism/errors/match_predicate_after_and_with_opreator.txt3
-rw-r--r--test/prism/errors/match_predicate_after_or_with_opreator.txt3
-rw-r--r--test/prism/errors/match_predicate_after_rescue_with_opreator.txt3
-rw-r--r--test/prism/errors/match_required_after_and_with_opreator.txt3
-rw-r--r--test/prism/errors/match_required_after_or_with_opreator.txt3
-rw-r--r--test/prism/errors/match_required_after_rescue_with_opreator.txt3
6 files changed, 18 insertions, 0 deletions
diff --git a/test/prism/errors/match_predicate_after_and_with_opreator.txt b/test/prism/errors/match_predicate_after_and_with_opreator.txt
new file mode 100644
index 0000000000..5a0c5925ea
--- /dev/null
+++ b/test/prism/errors/match_predicate_after_and_with_opreator.txt
@@ -0,0 +1,3 @@
+1 and 2 in 3 % 4
+ ^ unexpected '%', expecting end-of-input
+
diff --git a/test/prism/errors/match_predicate_after_or_with_opreator.txt b/test/prism/errors/match_predicate_after_or_with_opreator.txt
new file mode 100644
index 0000000000..8ea69e4787
--- /dev/null
+++ b/test/prism/errors/match_predicate_after_or_with_opreator.txt
@@ -0,0 +1,3 @@
+1 or 2 in 3 + 4
+ ^ unexpected '+', expecting end-of-input
+
diff --git a/test/prism/errors/match_predicate_after_rescue_with_opreator.txt b/test/prism/errors/match_predicate_after_rescue_with_opreator.txt
new file mode 100644
index 0000000000..b2363a544d
--- /dev/null
+++ b/test/prism/errors/match_predicate_after_rescue_with_opreator.txt
@@ -0,0 +1,3 @@
+1 rescue 2 in 3 << 4
+ ^~ unexpected <<, expecting end-of-input
+
diff --git a/test/prism/errors/match_required_after_and_with_opreator.txt b/test/prism/errors/match_required_after_and_with_opreator.txt
new file mode 100644
index 0000000000..eafbc1f12a
--- /dev/null
+++ b/test/prism/errors/match_required_after_and_with_opreator.txt
@@ -0,0 +1,3 @@
+1 and 2 => 3 - 4
+ ^ unexpected '-', expecting end-of-input
+
diff --git a/test/prism/errors/match_required_after_or_with_opreator.txt b/test/prism/errors/match_required_after_or_with_opreator.txt
new file mode 100644
index 0000000000..c35f3b66e4
--- /dev/null
+++ b/test/prism/errors/match_required_after_or_with_opreator.txt
@@ -0,0 +1,3 @@
+1 or 2 => 3 ^ 4
+ ^ unexpected '^', expecting end-of-input
+
diff --git a/test/prism/errors/match_required_after_rescue_with_opreator.txt b/test/prism/errors/match_required_after_rescue_with_opreator.txt
new file mode 100644
index 0000000000..903e2ccc8e
--- /dev/null
+++ b/test/prism/errors/match_required_after_rescue_with_opreator.txt
@@ -0,0 +1,3 @@
+1 rescue 2 => 3 ** 4
+ ^~ unexpected '**', expecting end-of-input
+