summaryrefslogtreecommitdiff
path: root/test/ruby/test_rubyoptions.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-27 06:47:00 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-27 06:47:00 +0000
commit832c74f428db6c5bd6e575e1f6ea7fe0891c84d2 (patch)
treec3f2ae41becea90fd84e395fe5e0e7ff38581ed9 /test/ruby/test_rubyoptions.rb
parent859337b17b5e1f9ee9ebeb0ac9e3ed7d73691ca2 (diff)
ruby.c: frozen-string-literal option
* ruby.c (process_options): add an option to enable/disable frozen-string-literal. [Feature #8976] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_rubyoptions.rb')
-rw-r--r--test/ruby/test_rubyoptions.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index efdaeed237..927ad8ad8d 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -783,4 +783,19 @@ class TestRubyOptions < Test::Unit::TestCase
def test_dump_insns_with_rflag
assert_norun_with_rflag('--dump=insns')
end
+
+ def test_frozen_string_literal
+ results = {}
+ %W[frozen_string_literal frozen_string_literal].each do |arg|
+ [["disable", "false"], ["enable", "true"]].each do |opt, exp|
+ key = "#{opt}=#{arg}"
+ begin
+ assert_in_out_err(["--disable=gems", "--#{key}"], 'p("foo".frozen?)', [exp])
+ rescue MiniTest::Assertion => e
+ results[key] = e
+ end
+ end
+ end
+ assert_empty(results)
+ end
end