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

ruby-changes:39952

From: akr <ko1@a...>
Date: Mon, 5 Oct 2015 12:19:43 +0900 (JST)
Subject: [ruby-changes:39952] akr:r52033 (trunk): specify frozen_string_literal: true.

akr	2015-10-05 12:19:30 +0900 (Mon, 05 Oct 2015)

  New Revision: 52033

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

  Log:
    specify frozen_string_literal: true.

  Modified files:
    trunk/test/pathname/test_pathname.rb
Index: test/pathname/test_pathname.rb
===================================================================
--- test/pathname/test_pathname.rb	(revision 52032)
+++ test/pathname/test_pathname.rb	(revision 52033)
@@ -1,3 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/test/pathname/test_pathname.rb#L1
+# -*- frozen_string_literal: true -*-
+
 require 'test/unit'
 require 'pathname'
 
@@ -189,8 +191,8 @@ class TestPathname < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/pathname/test_pathname.rb#L191
 
   if DOSISH
     defassert(:del_trailing_separator, "a", "a\\")
-    defassert(:del_trailing_separator, "\225\\".force_encoding("cp932"), "\225\\\\".force_encoding("cp932"))
-    defassert(:del_trailing_separator, "\225".force_encoding("cp437"), "\225\\\\".force_encoding("cp437"))
+    defassert(:del_trailing_separator, "\225\\".dup.force_encoding("cp932"), "\225\\\\".dup.force_encoding("cp932"))
+    defassert(:del_trailing_separator, "\225".dup.force_encoding("cp437"), "\225\\\\".dup.force_encoding("cp437"))
   end
 
   def test_plus
@@ -585,16 +587,16 @@ class TestPathname < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/pathname/test_pathname.rb#L587
     obj = Pathname.new("a"); assert_same(obj, obj.taint)
     obj = Pathname.new("a"); assert_same(obj, obj.untaint)
 
-    assert_equal(false, Pathname.new("a"      )           .tainted?)
-    assert_equal(false, Pathname.new("a"      )      .to_s.tainted?)
-    assert_equal(true,  Pathname.new("a"      ).taint     .tainted?)
-    assert_equal(true,  Pathname.new("a"      ).taint.to_s.tainted?)
-    assert_equal(true,  Pathname.new("a".taint)           .tainted?)
-    assert_equal(true,  Pathname.new("a".taint)      .to_s.tainted?)
-    assert_equal(true,  Pathname.new("a".taint).taint     .tainted?)
-    assert_equal(true,  Pathname.new("a".taint).taint.to_s.tainted?)
+    assert_equal(false, Pathname.new("a"          )           .tainted?)
+    assert_equal(false, Pathname.new("a"          )      .to_s.tainted?)
+    assert_equal(true,  Pathname.new("a"          ).taint     .tainted?)
+    assert_equal(true,  Pathname.new("a"          ).taint.to_s.tainted?)
+    assert_equal(true,  Pathname.new("a".dup.taint)           .tainted?)
+    assert_equal(true,  Pathname.new("a".dup.taint)      .to_s.tainted?)
+    assert_equal(true,  Pathname.new("a".dup.taint).taint     .tainted?)
+    assert_equal(true,  Pathname.new("a".dup.taint).taint.to_s.tainted?)
 
-    str = "a"
+    str = "a".dup
     path = Pathname.new(str)
     str.taint
     assert_equal(false, path     .tainted?)
@@ -607,7 +609,7 @@ class TestPathname < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/pathname/test_pathname.rb#L609
     assert_equal(false, Pathname.new("a").taint.untaint     .tainted?)
     assert_equal(false, Pathname.new("a").taint.untaint.to_s.tainted?)
 
-    str = "a".taint
+    str = "a".dup.taint
     path = Pathname.new(str)
     str.untaint
     assert_equal(true, path     .tainted?)

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

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