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 'test/unit'
|
||||||
require 'pathname'
|
require 'pathname'
|
||||||
|
|
||||||
|
@ -189,8 +191,8 @@ class TestPathname < Test::Unit::TestCase
|
||||||
|
|
||||||
if DOSISH
|
if DOSISH
|
||||||
defassert(:del_trailing_separator, "a", "a\\")
|
defassert(:del_trailing_separator, "a", "a\\")
|
||||||
defassert(:del_trailing_separator, "\225\\".force_encoding("cp932"), "\225\\\\".force_encoding("cp932"))
|
defassert(:del_trailing_separator, "\225\\".dup.force_encoding("cp932"), "\225\\\\".dup.force_encoding("cp932"))
|
||||||
defassert(:del_trailing_separator, "\225".force_encoding("cp437"), "\225\\\\".force_encoding("cp437"))
|
defassert(:del_trailing_separator, "\225".dup.force_encoding("cp437"), "\225\\\\".dup.force_encoding("cp437"))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_plus
|
def test_plus
|
||||||
|
@ -589,12 +591,12 @@ class TestPathname < Test::Unit::TestCase
|
||||||
assert_equal(false, Pathname.new("a" ) .to_s.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 .tainted?)
|
||||||
assert_equal(true, Pathname.new("a" ).taint.to_s.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".dup.taint) .tainted?)
|
||||||
assert_equal(true, Pathname.new("a".taint) .to_s.tainted?)
|
assert_equal(true, Pathname.new("a".dup.taint) .to_s.tainted?)
|
||||||
assert_equal(true, Pathname.new("a".taint).taint .tainted?)
|
assert_equal(true, Pathname.new("a".dup.taint).taint .tainted?)
|
||||||
assert_equal(true, Pathname.new("a".taint).taint.to_s.tainted?)
|
assert_equal(true, Pathname.new("a".dup.taint).taint.to_s.tainted?)
|
||||||
|
|
||||||
str = "a"
|
str = "a".dup
|
||||||
path = Pathname.new(str)
|
path = Pathname.new(str)
|
||||||
str.taint
|
str.taint
|
||||||
assert_equal(false, path .tainted?)
|
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 .tainted?)
|
||||||
assert_equal(false, Pathname.new("a").taint.untaint.to_s.tainted?)
|
assert_equal(false, Pathname.new("a").taint.untaint.to_s.tainted?)
|
||||||
|
|
||||||
str = "a".taint
|
str = "a".dup.taint
|
||||||
path = Pathname.new(str)
|
path = Pathname.new(str)
|
||||||
str.untaint
|
str.untaint
|
||||||
assert_equal(true, path .tainted?)
|
assert_equal(true, path .tainted?)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue