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_array.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_array.rb')
-rw-r--r-- | test/ruby/test_array.rb | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index 63db980357..93ef59a3f5 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -476,20 +476,16 @@ class TestArray < Test::Unit::TestCase def test_clone for taint in [ false, true ] - for untrust in [ false, true ] - for frozen in [ false, true ] - a = @cls[*(0..99).to_a] - a.taint if taint - a.untrust if untrust - a.freeze if frozen - b = a.clone - - assert_equal(a, b) - assert_not_equal(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 = @cls[*(0..99).to_a] + a.taint if taint + a.freeze if frozen + b = a.clone + + assert_equal(a, b) + assert_not_equal(a.__id__, b.__id__) + assert_equal(a.frozen?, b.frozen?) + assert_equal(a.tainted?, b.tainted?) end end end @@ -756,10 +752,8 @@ class TestArray < Test::Unit::TestCase a6 = @cls[[1, 2], 3] a6.taint - a6.untrust a7 = a6.flatten assert_equal(true, a7.tainted?) - assert_equal(true, a7.untrusted?) a8 = @cls[[1, 2], 3] a9 = a8.flatten(0) @@ -950,23 +944,18 @@ class TestArray < Test::Unit::TestCase $, = "" a = @cls[1, 2, 3] a.taint - a.untrust s = a.join assert_equal(true, s.tainted?) - assert_equal(true, s.untrusted?) bug5902 = '[ruby-core:42161]' - sep = ":".taint.untrust + sep = ":".taint s = @cls[].join(sep) assert_equal(false, s.tainted?, bug5902) - assert_equal(false, s.untrusted?, bug5902) s = @cls[1].join(sep) assert_equal(false, s.tainted?, bug5902) - assert_equal(false, s.untrusted?, bug5902) s = @cls[1, 2].join(sep) assert_equal(true, s.tainted?, bug5902) - assert_equal(true, s.untrusted?, bug5902) e = ''.force_encoding('EUC-JP') u = ''.force_encoding('UTF-8') @@ -2170,10 +2159,8 @@ class TestArray < Test::Unit::TestCase def test_inspect a = @cls[1, 2, 3] a.taint - a.untrust s = a.inspect assert_equal(true, s.tainted?) - assert_equal(true, s.untrusted?) end def test_initialize2 |