diff options
author | TSUYUSATO Kitsune <make.just.on@gmail.com> | 2023-11-15 23:05:08 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-11-22 14:53:28 +0000 |
commit | 8794836bf256c4bad51111b085f9d07e463432a0 (patch) | |
tree | 04e05461f87cf359ac877f03d111a31b99e04601 /test/prism/errors_test.rb | |
parent | 2aefbbaab9c9a86fb70f30bca86ed73411679d6d (diff) | |
download | ruby-8794836bf256c4bad51111b085f9d07e463432a0.tar.gz |
[ruby/prism] Fix associativity of binary range with begin-less range
Fix https://github.com/ruby/prism/pull/1828
https://github.com/ruby/prism/commit/22c0640e48
Diffstat (limited to 'test/prism/errors_test.rb')
-rw-r--r-- | test/prism/errors_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/prism/errors_test.rb b/test/prism/errors_test.rb index bc3f3ebee9..5572a3254f 100644 --- a/test/prism/errors_test.rb +++ b/test/prism/errors_test.rb @@ -1770,6 +1770,21 @@ module Prism ] end + def test_binary_range_with_left_unary_range + source = <<~RUBY + ..1.. + ...1.. + RUBY + message1 = 'Expected a newline or semicolon after the statement' + message2 = 'Cannot parse the expression' + assert_errors expression(source), source, [ + [message1, 3..3], + [message2, 3..3], + [message1, 10..10], + [message2, 10..10], + ] + end + private def assert_errors(expected, source, errors, compare_ripper: RUBY_ENGINE == "ruby") |