diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-05 03:19:30 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-05 03:19:30 +0000 |
commit | 12c367ca505f3aa829dba6770dc575b5432d3caa (patch) | |
tree | 86d56698dedf99e933298a319cd9352e3712e58d /test/pathname | |
parent | 4d753671b2172d82d7d2dfb6929c30374a7a9996 (diff) |
specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/pathname')
-rw-r--r-- | test/pathname/test_pathname.rb | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb index daa32111bc..339ef7f487 100644 --- a/test/pathname/test_pathname.rb +++ b/test/pathname/test_pathname.rb @@ -1,3 +1,5 @@ +# -*- frozen_string_literal: true -*- + require 'test/unit' require 'pathname' @@ -189,8 +191,8 @@ class TestPathname < Test::Unit::TestCase 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::TestCase 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::TestCase 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?) |