diff options
| author | Jemma Issroff <jemmaissroff@gmail.com> | 2023-12-15 16:28:29 -0500 |
|---|---|---|
| committer | Aaron Patterson <aaron.patterson@gmail.com> | 2024-01-12 12:20:04 -0800 |
| commit | 84f14ff08925889964cd5e7ed0bfc9ee8fcefce2 (patch) | |
| tree | 35899252a5ff262ecd0de4361d5d16a8fe30e50e /test/ruby | |
| parent | e59dd7094f281e3167fc8fe29ab0e92e7b66027a (diff) | |
[PRISM] Pre-concatenate Strings in InterpolatedStringNode
This commit concatenates String VALUEs within
InterpolatedStringNodes to allow us to preserve frozenness of
concatenated strings such as `"a""b"`
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_compile_prism.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb index 965f3d3c91..78800fed7c 100644 --- a/test/ruby/test_compile_prism.rb +++ b/test/ruby/test_compile_prism.rb @@ -589,6 +589,17 @@ module Prism assert_prism_eval('$pit = 1; "1 #$pit 1"') assert_prism_eval('"1 #{1 + 2} 1"') assert_prism_eval('"Prism" "::" "TestCompilePrism"') + assert_prism_eval('("a""b").frozen?') + assert_prism_eval(<<-CODE) + # frozen_string_literal: true + + ("a""b").frozen? + CODE + assert_prism_eval(<<-CODE) + # frozen_string_literal: true + + ("a""b""#{1}").frozen? + CODE end def test_InterpolatedSymbolNode |
