summaryrefslogtreecommitdiff
path: root/test/ruby/test_rubyoptions.rb
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-09 17:02:02 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-09 17:02:02 +0000
commit6fb2ec53949c149323d2b0f264bf4c68be558b8f (patch)
tree74e9c8645f64bcb766785a7dbaa60afb93de3199 /test/ruby/test_rubyoptions.rb
parentc7e51700ca5060a7d4fbc9f8cd99f8471b5f0935 (diff)
* compile.c (iseq_compile_each): do not add debug information
without --debug or --debug=frozen-string-literal option because String#dup slows down with debug information. [Feature #11725] * NEWS: apply about it. * test/ruby/test_rubyoptions.rb: catch up this fix with refactoring. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_rubyoptions.rb')
-rw-r--r--test/ruby/test_rubyoptions.rb17
1 files changed, 11 insertions, 6 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index 1f47e7bd0f..96ceb798b1 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -806,15 +806,20 @@ class TestRubyOptions < Test::Unit::TestCase
end
def test_frozen_string_literal_debug
- assert_in_out_err(["--disable=gems", "--enable-frozen-string-literal", "--debug-frozen-string-literal" ], '"foo" << "bar"', [], /created at/)
- assert_in_out_err(["--disable=gems", "--enable-frozen-string-literal", ], '"foo" << "bar"', [], /created at/)
- assert_in_out_err(["--disable=gems", "--enable-frozen-string-literal", "--debug-frozen-string-literal" ], '"foo#{123}bar" << "bar"', [], /created at/)
- assert_in_out_err(["--disable=gems", "--enable-frozen-string-literal", ], '"foo#{123}bar" << "bar"', [], /can\'t modify frozen String \(RuntimeError\)\n\z/)
+ with_debug_pat = /created at/
+ wo_debug_pat = /can\'t modify frozen String \(RuntimeError\)\n\z/
+
+ assert_in_out_err(["--disable=gems", "--enable-frozen-string-literal", "--debug-frozen-string-literal" ], '"foo" << "bar"', [], with_debug_pat)
+ assert_in_out_err(["--disable=gems", "--enable-frozen-string-literal", "--debug=frozen-string-literal" ], '"foo" << "bar"', [], with_debug_pat)
+ assert_in_out_err(["--disable=gems", "--enable-frozen-string-literal", ], '"foo" << "bar"', [], wo_debug_pat)
+ assert_in_out_err(["--disable=gems", "--enable-frozen-string-literal", "--debug-frozen-string-literal" ], '"foo#{123}bar" << "bar"', [], with_debug_pat)
+ assert_in_out_err(["--disable=gems", "--enable-frozen-string-literal", "--debug=frozen-string-literal" ], '"foo#{123}bar" << "bar"', [], with_debug_pat)
+ assert_in_out_err(["--disable=gems", "--enable-frozen-string-literal", ], '"foo#{123}bar" << "bar"', [], wo_debug_pat)
assert_in_out_err(["--disable=gems", "--disable-frozen-string-literal", "--debug-frozen-string-literal" ], '"foo" << "bar"', [], [])
+ assert_in_out_err(["--disable=gems", "--disable-frozen-string-literal", "--debug=frozen-string-literal" ], '"foo" << "bar"', [], [])
assert_in_out_err(["--disable=gems", "--disable-frozen-string-literal", ], '"foo" << "bar"', [], [])
assert_in_out_err(["--disable=gems", "--debug-frozen-string-literal" ], '"foo" << "bar"', [], [])
+ assert_in_out_err(["--disable=gems", "--debug=frozen-string-literal" ], '"foo" << "bar"', [], [])
assert_in_out_err(["--disable=gems", ], '"foo" << "bar"', [], [])
- assert_in_out_err(["--disable=gems", "--enable-frozen-string-literal", ], '"foo" << "bar"', [], /created at/)
- assert_in_out_err(["--disable=gems", "--enable-frozen-string-literal", ], '"foo#{123}bar" << "bar"', [], /can\'t modify frozen String \(RuntimeError\)\n\z/)
end
end