summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHaldun Bayhantopcu <haldun@github.com>2023-09-28 11:45:35 +0200
committergit <svn-admin@ruby-lang.org>2023-09-28 13:32:02 +0000
commit834560a923dcc4aa6685fb7fd7aecae1808217f1 (patch)
tree1c47fe03326eb8f3b2f3c7586e53e7c29d2911ae /test
parent7799fe90da49958af0d33d18c82f12012610f32a (diff)
[ruby/prism] Check whether the predicate is closed for conditionals
https://github.com/ruby/prism/commit/bf43006d0a
Diffstat (limited to 'test')
-rw-r--r--test/prism/errors_test.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/prism/errors_test.rb b/test/prism/errors_test.rb
index 372e7791db..a101dfa87e 100644
--- a/test/prism/errors_test.rb
+++ b/test/prism/errors_test.rb
@@ -1317,10 +1317,11 @@ module Prism
end
def test_conditional_predicate_closed
- source = "if 0 0; end\nunless 0 0; end"
+ source = "if 0 0; elsif 0 0; end\nunless 0 0; end"
assert_errors expression(source), source, [
["Expected `then` or `;` or '\n" + "'", 5..6],
- ["Expected `then` or `;` or '\n" + "'", 21..22],
+ ["Expected `then` or `;` or '\n" + "'", 16..17],
+ ["Expected `then` or `;` or '\n" + "'", 32..33],
]
end