diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-09-27 09:27:57 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-09-27 09:27:57 +0000 |
commit | a0b2b749e80991f50abd14659fea15cb35725ba3 (patch) | |
tree | de454166943c5132001c43627b53d129e3899949 | |
parent | bbd49febf3862efe8b2057768b872de6e54baf39 (diff) | |
download | ruby-a0b2b749e80991f50abd14659fea15cb35725ba3.tar.gz |
test_rubyoptions.rb: test combinations
* test/ruby/test_rubyoptions.rb (test_frozen_string_literal): test
combinations of command line option and pragma.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/ruby/test_rubyoptions.rb | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 927ad8ad8d..f446afc48e 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -785,17 +785,23 @@ class TestRubyOptions < Test::Unit::TestCase end def test_frozen_string_literal - results = {} - %W[frozen_string_literal frozen_string_literal].each do |arg| + all_assertions do |a| [["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 + %W[frozen_string_literal frozen-string-literal].each do |arg| + key = "#{opt}=#{arg}" + a.for(key) do + assert_in_out_err(["--disable=gems", "--#{key}"], 'p("foo".frozen?)', [exp]) + end + end + end + %W"disable enable".product(%W[false true]) do |opt, exp| + a.for("#{opt}=>#{exp}") do + assert_in_out_err(["-w", "--disable=gems", "--#{opt}=frozen-string-literal"], <<-"end;", [exp]) + #-*- frozen-string-literal: #{exp} -*- + p("foo".frozen?) + end; end end end - assert_empty(results) end end |