aboutsummaryrefslogtreecommitdiffstats
path: root/test/prism/errors_test.rb
diff options
context:
space:
mode:
authorHaldun Bayhantopcu <haldun@github.com>2023-10-11 23:35:14 +0200
committergit <svn-admin@ruby-lang.org>2023-10-12 16:01:40 +0000
commit4387af1b4a16fbd181a7c42424ffb8cf92d55110 (patch)
treef2c0c2bcf286003ab71a270f4aa5f12625898309 /test/prism/errors_test.rb
parent5c8764477faeae1c6f866b2613b4319ba183a86b (diff)
downloadruby-4387af1b4a16fbd181a7c42424ffb8cf92d55110.tar.gz
[ruby/prism] Fix parsing symbols in strings after labels
https://github.com/ruby/prism/commit/e16531650d
Diffstat (limited to 'test/prism/errors_test.rb')
-rw-r--r--test/prism/errors_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/prism/errors_test.rb b/test/prism/errors_test.rb
index 8a88270b44..e2f56ff07e 100644
--- a/test/prism/errors_test.rb
+++ b/test/prism/errors_test.rb
@@ -1404,6 +1404,20 @@ module Prism
]
end
+ def test_symbol_in_keyword_parameter
+ source = "def foo(x:'y':); end"
+ assert_errors expression(source), source, [
+ ["Expected a closing delimiter for the string literal", 14..14],
+ ]
+ end
+
+ def test_symbol_in_hash
+ source = "{x:'y':}"
+ assert_errors expression(source), source, [
+ ["Expected a closing delimiter for the string literal", 7..7],
+ ]
+ end
+
private
def assert_errors(expected, source, errors, compare_ripper: RUBY_ENGINE == "ruby")