[前][次][番号順一覧][スレッド一覧]

ruby-changes:55188

From: kazu <ko1@a...>
Date: Mon, 1 Apr 2019 00:37:49 +0900 (JST)
Subject: [ruby-changes:55188] kazu:r67395 (trunk): exp is String, so it's always truthy

kazu	2019-04-01 00:37:45 +0900 (Mon, 01 Apr 2019)

  New Revision: 67395

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67395

  Log:
    exp is String, so it's always truthy

  Modified files:
    trunk/test/ruby/test_rubyoptions.rb
Index: test/ruby/test_rubyoptions.rb
===================================================================
--- test/ruby/test_rubyoptions.rb	(revision 67394)
+++ test/ruby/test_rubyoptions.rb	(revision 67395)
@@ -968,7 +968,7 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L968
       [["disable", "false"], ["enable", "true"]].each do |opt, exp|
         %W[frozen_string_literal frozen-string-literal].each do |arg|
           key = "#{opt}=#{arg}"
-          negopt = exp ? "disable" : "enable"
+          negopt = exp == "true" ? "disable" : "enable"
           env = {"RUBYOPT"=>"--#{negopt}=#{arg}"}
           a.for(key) do
             assert_in_out_err([env, "--disable=gems", "--#{key}"], 'p("foo".frozen?)', [exp])

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]