diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-12 21:04:35 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-12 21:04:35 +0000 |
commit | 769f5fc41cbc2e32f757a4e26e4ad7f2920e1671 (patch) | |
tree | bbd861eff750d6b800786658880317d05835991c /test/ruby/test_string.rb | |
parent | 0ba69794c683d53cbcf1d5500828a20f2bef8970 (diff) | |
download | ruby-769f5fc41cbc2e32f757a4e26e4ad7f2920e1671.tar.gz |
Clean warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_string.rb')
-rw-r--r-- | test/ruby/test_string.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 22938e0c1f..d4a38054ad 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -175,9 +175,11 @@ class TestString < Test::Unit::TestCase def o.<=>(x); nil; end assert_nil("foo" <=> o) + class<<o;undef <=>;end def o.<=>(x); 1; end assert_equal(-1, "foo" <=> o) + class<<o;undef <=>;end def o.<=>(x); 2**100; end assert_equal(-(2**100), "foo" <=> o) end @@ -200,6 +202,7 @@ class TestString < Test::Unit::TestCase def o.to_str; end def o.==(x); false; end assert_equal(false, "foo" == o) + class<<o;undef ==;end def o.==(x); true; end assert_equal(true, "foo" == o) end @@ -1815,6 +1818,7 @@ class TestString < Test::Unit::TestCase c.class_eval { attr 1 } end + class<<o;undef to_str;end def o.to_str; "foo"; end assert_nothing_raised do c.class_eval { attr o } @@ -1839,11 +1843,13 @@ class TestString < Test::Unit::TestCase assert_equal("\u3042", ("\u3042" * 100)[-1]) end +=begin def test_compare_different_encoding_string s1 = "\xff".force_encoding("UTF-8") s2 = "\xff".force_encoding("ISO-2022-JP") - #assert_equal([-1, 1], [s1 <=> s2, s2 <=> s1].sort) + assert_equal([-1, 1], [s1 <=> s2, s2 <=> s1].sort) end +=end def test_casecmp assert_equal(1, "\u3042B".casecmp("\u3042a")) @@ -1862,12 +1868,13 @@ class TestString < Test::Unit::TestCase assert_raise(Encoding::CompatibilityError) { "\u3042".encode("ISO-2022-JP").rstrip } end +=begin def test_symbol_table_overflow - return assert_in_out_err([], <<-INPUT, [], /symbol table overflow \(symbol [a-z]{8}\) \(RuntimeError\)/) ("aaaaaaaa".."zzzzzzzz").each {|s| s.to_sym } INPUT end +=end def test_shared_force_encoding s = "\u{3066}\u{3059}\u{3068}".gsub(//, '') |