summaryrefslogtreecommitdiff
path: root/test/ruby/test_rubyoptions.rb
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2024-03-13 12:50:11 +0100
committerJean Boussier <[email protected]>2024-03-14 17:56:15 +0100
commit09d8c99cdcb04fb6c6c8e61c9dea28927a3a0b46 (patch)
tree646ab40dec94c5bd405b485e62f00343cc50db72 /test/ruby/test_rubyoptions.rb
parent4e03d56e21e3df98a828c8efb7011b01db1a8d52 (diff)
Ensure test suite is compatible with --frozen-string-literal
As preparation for https://bugs.ruby-lang.org/issues/20205 making sure the test suite is compatible with frozen string literals is making things easier.
Diffstat (limited to 'test/ruby/test_rubyoptions.rb')
-rw-r--r--test/ruby/test_rubyoptions.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index 29810d5dd7..446548d6d9 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -1196,13 +1196,16 @@ class TestRubyOptions < Test::Unit::TestCase
end
def test_frozen_string_literal_debug
+ default_frozen = eval("'test'").frozen?
+
with_debug_pat = /created at/
wo_debug_pat = /can\'t modify frozen String: "\w+" \(FrozenError\)\n\z/
frozen = [
["--enable-frozen-string-literal", true],
["--disable-frozen-string-literal", false],
- [nil, false],
]
+ frozen << [nil, false] unless default_frozen
+
debugs = [
["--debug-frozen-string-literal", true],
["--debug=frozen-string-literal", true],