diff options
author | Haldun Bayhantopcu <haldun@github.com> | 2023-09-20 10:36:26 +0200 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-09-20 17:50:32 +0000 |
commit | 0a630fa461a7260235842e482f682deca30172d6 (patch) | |
tree | 647eccd7e9a4be6eb884edaa3e44b19bcbd0af2a /test/yarp | |
parent | 639971a0800a4ca1afe9c741e42c0fbd94aa0879 (diff) | |
download | ruby-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.rb | 8 |
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") |