aboutsummaryrefslogtreecommitdiffstats
path: root/test/yarp
diff options
context:
space:
mode:
authorHaldun Bayhantopcu <haldun@github.com>2023-09-22 19:33:47 +0200
committergit <svn-admin@ruby-lang.org>2023-09-26 15:08:25 +0000
commit3f511a1d093a85da4f224c0651f8cf922f02f501 (patch)
tree7c81b130166f7647f00d0ff60b00231f277e0a73 /test/yarp
parent3f1cfc43bdefb45de643076be4602e7b3f432779 (diff)
downloadruby-3f511a1d093a85da4f224c0651f8cf922f02f501.tar.gz
[ruby/yarp] Check predicate of while and until
https://github.com/ruby/yarp/commit/f57a6066b5
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 3a7396ea14..2b3c8f5c89 100644
--- a/test/yarp/errors_test.rb
+++ b/test/yarp/errors_test.rb
@@ -1340,6 +1340,14 @@ module YARP
]
end
+ def test_loop_conditional_is_closed
+ source = "while 0 0; foo; end; until 0 0; foo; end"
+ assert_errors expression(source), source, [
+ ["Expected a predicate expression for the `while` statement", 7..7],
+ ["Expected a predicate expression for the `until` statement", 28..28],
+ ]
+ end
+
private
def assert_errors(expected, source, errors, compare_ripper: RUBY_ENGINE == "ruby")