mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4d753671b2
commit
12c367ca50
1 changed files with 14 additions and 12 deletions
|
@ -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?)
|
||||
|
|
Loading…
Add table
Reference in a new issue