aboutsummaryrefslogtreecommitdiffstats
path: root/test/yarp
diff options
context:
space:
mode:
authorHaldun Bayhantopcu <haldun@github.com>2023-09-20 10:36:26 +0200
committergit <svn-admin@ruby-lang.org>2023-09-20 17:50:32 +0000
commit0a630fa461a7260235842e482f682deca30172d6 (patch)
tree647eccd7e9a4be6eb884edaa3e44b19bcbd0af2a /test/yarp
parent639971a0800a4ca1afe9c741e42c0fbd94aa0879 (diff)
downloadruby-0a630fa461a7260235842e482f682deca30172d6.tar.gz
[ruby/yarp] Check whether the conditional predicate is closed
https://github.com/ruby/yarp/commit/5022b51db2
Diffstat (limited to 'test/yarp')
-rw-r--r--test/yarp/errors_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/yarp/errors_test.rb b/test/yarp/errors_test.rb
index 5a4d469c26..110834428b 100644
--- a/test/yarp/errors_test.rb
+++ b/test/yarp/errors_test.rb
@@ -1302,6 +1302,14 @@ module YARP
assert_error_messages "%sXfooX", error_messages
end
+ def test_conditional_predicate_closed
+ source = "if 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],
+ ]
+ end
+
private
def assert_errors(expected, source, errors, compare_ripper: RUBY_ENGINE == "ruby")