From 832c74f428db6c5bd6e575e1f6ea7fe0891c84d2 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 27 Sep 2015 06:47:00 +0000 Subject: 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 --- test/ruby/test_rubyoptions.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/ruby/test_rubyoptions.rb') 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 -- cgit v1.2.3