aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_symbol.rb
diff options
context:
space:
mode:
authorstomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-21 19:27:08 +0000
committerstomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-21 19:27:08 +0000
commit4527a721964bf265199b50da48a95febc2f62cfc (patch)
treeca4e96cfa480ad79d3ef52ef64be7b6e5ddf6097 /test/ruby/test_symbol.rb
parente8312dc70e7a256301a51faf3e746c27dcf11c59 (diff)
downloadruby-4527a721964bf265199b50da48a95febc2f62cfc.tar.gz
test_string.rb,test_symbol.rb: add some tests
* test/ruby/test_string.rb: add more test cases for String#casecmp. * test/ruby/test_symbol.rb: ditto for Symbol#{casecmp,casecmp?}. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_symbol.rb')
-rw-r--r--test/ruby/test_symbol.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb
index 279c23cdb8..e7f3d5a527 100644
--- a/test/ruby/test_symbol.rb
+++ b/test/ruby/test_symbol.rb
@@ -286,15 +286,19 @@ class TestSymbol < Test::Unit::TestCase
assert_equal(0, :FoO.casecmp(:fOO))
assert_equal(1, :FoO.casecmp(:BaR))
assert_equal(-1, :baR.casecmp(:FoO))
+
assert_nil(:foo.casecmp("foo"))
+ assert_nil(:foo.casecmp(Object.new))
end
def test_casecmp?
assert_equal(true, :FoO.casecmp?(:fOO))
assert_equal(false, :FoO.casecmp?(:BaR))
assert_equal(false, :baR.casecmp?(:FoO))
- assert_nil(:foo.casecmp?("foo"))
assert_equal(true, :äöü.casecmp?(:ÄÖÜ))
+
+ assert_nil(:foo.casecmp?("foo"))
+ assert_nil(:foo.casecmp?(Object.new))
end
def test_length