diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-09-27 06:47:00 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-09-27 06:47:00 +0000 |
commit | 832c74f428db6c5bd6e575e1f6ea7fe0891c84d2 (patch) | |
tree | c3f2ae41becea90fd84e395fe5e0e7ff38581ed9 /test/ruby | |
parent | 859337b17b5e1f9ee9ebeb0ac9e3ed7d73691ca2 (diff) | |
download | ruby-832c74f428db6c5bd6e575e1f6ea7fe0891c84d2.tar.gz |
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')
-rw-r--r-- | test/ruby/test_rubyoptions.rb | 15 |
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 |