diff options
author | Jean Boussier <[email protected]> | 2024-03-13 12:50:11 +0100 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2024-03-14 17:56:15 +0100 |
commit | 09d8c99cdcb04fb6c6c8e61c9dea28927a3a0b46 (patch) | |
tree | 646ab40dec94c5bd405b485e62f00343cc50db72 /bootstraptest/runner.rb | |
parent | 4e03d56e21e3df98a828c8efb7011b01db1a8d52 (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 'bootstraptest/runner.rb')
-rwxr-xr-x | bootstraptest/runner.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb index 039a15148d..1851640d1f 100755 --- a/bootstraptest/runner.rb +++ b/bootstraptest/runner.rb @@ -548,10 +548,10 @@ class Assertion < Struct.new(:src, :path, :lineno, :proc) end end - def make_srcfile(frozen_string_literal: nil) + def make_srcfile(frozen_string_literal: true) filename = "bootstraptest.#{self.path}_#{self.lineno}_#{self.id}.rb" File.open(filename, 'w') {|f| - f.puts "#frozen_string_literal:true" if frozen_string_literal + f.puts "#frozen_string_literal:#{frozen_string_literal}" unless frozen_string_literal.nil? if $stress f.puts "GC.stress = true" if $stress else @@ -572,9 +572,9 @@ def add_assertion src, pr Assertion.new(src, path, lineno, pr) end -def assert_equal(expected, testsrc, message = '', opt = '', **argh) +def assert_equal(expected, testsrc, message = '', opt = '', **kwargs) add_assertion testsrc, -> as do - as.assert_check(message, opt, **argh) {|result| + as.assert_check(message, opt, **kwargs) {|result| if expected == result nil else @@ -585,9 +585,9 @@ def assert_equal(expected, testsrc, message = '', opt = '', **argh) end end -def assert_match(expected_pattern, testsrc, message = '') +def assert_match(expected_pattern, testsrc, message = '', **argh) add_assertion testsrc, -> as do - as.assert_check(message) {|result| + as.assert_check(message, **argh) {|result| if expected_pattern =~ result nil else |