diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-13 05:41:44 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-13 05:41:44 +0000 |
commit | 1474dd064b28e4a813a79342c5523cede60f83c7 (patch) | |
tree | 18eed509f9c6e01f993948b733c165f6006a2450 /test/ruby/test_string.rb | |
parent | 90026ab53f89304438d907c0c7cc23afccc6edb7 (diff) | |
download | ruby-1474dd064b28e4a813a79342c5523cede60f83c7.tar.gz |
* test/-ext-/test_printf.rb, test/rss/test_parser.rb,
test/ruby/test_array.rb, test/ruby/test_hash.rb,
test/ruby/test_m17n.rb, test/ruby/test_marshal.rb,
test/ruby/test_object.rb, test/ruby/test_string.rb: don't use
untrusted?, untrust, and trust to avoid warnings in case $VERBOSE is
true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_string.rb')
-rw-r--r-- | test/ruby/test_string.rb | 60 |
1 files changed, 20 insertions, 40 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 651ab7c90c..9db3d2cb0f 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -451,20 +451,16 @@ class TestString < Test::Unit::TestCase def test_clone for taint in [ false, true ] - for untrust in [ false, true ] - for frozen in [ false, true ] - a = S("Cool") - a.taint if taint - a.untrust if untrust - a.freeze if frozen - b = a.clone - - assert_equal(a, b) - assert(a.__id__ != b.__id__) - assert_equal(a.frozen?, b.frozen?) - assert_equal(a.untrusted?, b.untrusted?) - assert_equal(a.tainted?, b.tainted?) - end + for frozen in [ false, true ] + a = S("Cool") + a.taint if taint + a.freeze if frozen + b = a.clone + + assert_equal(a, b) + assert(a.__id__ != b.__id__) + assert_equal(a.frozen?, b.frozen?) + assert_equal(a.tainted?, b.tainted?) end end @@ -588,20 +584,16 @@ class TestString < Test::Unit::TestCase def test_dup for taint in [ false, true ] - for untrust in [ false, true ] - for frozen in [ false, true ] - a = S("hello") - a.taint if taint - a.untrust if untrust - a.freeze if frozen - b = a.dup - - assert_equal(a, b) - assert(a.__id__ != b.__id__) - assert(!b.frozen?) - assert_equal(a.tainted?, b.tainted?) - assert_equal(a.untrusted?, b.untrusted?) - end + for frozen in [ false, true ] + a = S("hello") + a.taint if taint + a.freeze if frozen + b = a.dup + + assert_equal(a, b) + assert(a.__id__ != b.__id__) + assert(!b.frozen?) + assert_equal(a.tainted?, b.tainted?) end end end @@ -817,9 +809,7 @@ class TestString < Test::Unit::TestCase a = S("hello") a.taint - a.untrust assert(a.gsub(/./, S('X')).tainted?) - assert(a.gsub(/./, S('X')).untrusted?) assert_equal("z", "abc".gsub(/./, "a" => "z"), "moved from btest/knownbug") @@ -862,10 +852,8 @@ class TestString < Test::Unit::TestCase r = S('X') r.taint - r.untrust a.gsub!(/./, r) assert(a.tainted?) - assert(a.untrusted?) a = S("hello") assert_nil(a.sub!(S('X'), S('Y'))) @@ -1054,11 +1042,9 @@ class TestString < Test::Unit::TestCase a = S("foo") a.taint - a.untrust b = a.replace(S("xyz")) assert_equal(S("xyz"), b) assert(b.tainted?) - assert(b.untrusted?) s = "foo" * 100 s2 = ("bar" * 100).dup @@ -1152,11 +1138,9 @@ class TestString < Test::Unit::TestCase a = S("hello") a.taint - a.untrust res = [] a.scan(/./) { |w| res << w } assert(res[0].tainted?, '[ruby-core:33338] #4087') - assert(res[0].untrusted?, '[ruby-core:33338] #4087') end def test_size @@ -1439,10 +1423,8 @@ class TestString < Test::Unit::TestCase a = S("hello") a.taint - a.untrust x = a.sub(/./, S('X')) assert(x.tainted?) - assert(x.untrusted?) o = Object.new def o.to_str; "bar"; end @@ -1483,10 +1465,8 @@ class TestString < Test::Unit::TestCase r = S('X') r.taint - r.untrust a.sub!(/./, r) assert(a.tainted?) - assert(a.untrusted?) end def test_succ |