diff options
| author | Peter Zhu <peter@peterzhu.ca> | 2024-01-30 16:42:34 -0500 |
|---|---|---|
| committer | Kevin Newton <kddnewton@gmail.com> | 2024-02-05 11:55:44 -0500 |
| commit | 948c618bdadfc412678dd6e00e11fc8b85053173 (patch) | |
| tree | 74339ee8cc886fa76d95a41c03280c1f70b2f2c0 /test/ruby | |
| parent | 5e0c17145131e073814c7e5b15227d0b4e73cabe (diff) | |
[PRISM] Fix encoding of interpolated strings
Fixes ruby/prism#2313.
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_compile_prism.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb index e70c73c30a..e09192a4b2 100644 --- a/test/ruby/test_compile_prism.rb +++ b/test/ruby/test_compile_prism.rb @@ -712,6 +712,16 @@ module Prism ("a""#{1}""b").frozen? CODE + + # Test encoding of interpolated strings + assert_prism_eval(<<~'RUBY') + "#{"foo"}s".encoding + RUBY + assert_prism_eval(<<~'RUBY') + a = "foo" + b = "#{a}" << "Bar" + [a, b, b.encoding] + RUBY end def test_InterpolatedSymbolNode |
