diff options
| author | TSUYUSATO Kitsune <make.just.on@gmail.com> | 2023-12-11 12:44:33 +0900 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2023-12-11 13:36:37 +0000 |
| commit | 48cb70fee95dcdcf5f9eef2ef40c3adfecc214fa (patch) | |
| tree | 3b983fdf0c2800ad5d567bb22814b91752c77888 /test/prism | |
| parent | a860e3605c53e708d3cb06e2080ff73b58de4b22 (diff) | |
[ruby/prism] Fix parsing unterminated empty string `"`
Fix https://github.com/ruby/prism/pull/2034
https://github.com/ruby/prism/commit/8280e577fa
Diffstat (limited to 'test/prism')
| -rw-r--r-- | test/prism/errors_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/prism/errors_test.rb b/test/prism/errors_test.rb index 7744bd8b88..816df4667e 100644 --- a/test/prism/errors_test.rb +++ b/test/prism/errors_test.rb @@ -164,6 +164,15 @@ module Prism assert_equal expr.closing, "" end + def test_unterminated_empty_string + expr = expression('"') + assert_errors expr, '"', [ + ["expected a closing delimiter for the string literal", 1..1] + ] + assert_equal expr.unescaped, "" + assert_equal expr.closing, "" + end + def test_incomplete_instance_var_string assert_errors expression('%@#@@#'), '%@#@@#', [ ["incomplete instance variable", 4..5], |
