Update test_string.rb

This commit is contained in:
Erim Icel 2025-08-10 14:08:53 +01:00 committed by Nobuyoshi Nakada
parent 5e324ac11c
commit 09d6cfc55c

View file

@ -2842,6 +2842,9 @@ CODE
assert_nil(S("foo").casecmp(:foo))
assert_nil(S("foo").casecmp(Object.new))
assert_nil(S("foo").casecmp(0))
assert_nil(S("foo").casecmp(5.00))
o = Object.new
def o.to_str; "fOO"; end
assert_equal(0, S("FoO").casecmp(o))
@ -2867,6 +2870,9 @@ CODE
assert_nil(S("foo").casecmp?(:foo))
assert_nil(S("foo").casecmp?(Object.new))
assert_nil(S("foo").casecmp(0))
assert_nil(S("foo").casecmp(5.00))
o = Object.new
def o.to_str; "fOO"; end
assert_equal(true, S("FoO").casecmp?(o))