summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-symbol-ext/test
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-04-20 21:30:46 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-04-20 21:30:46 +0900
commita6941101933a06e234f57a180d7119eafa9f1904 (patch)
tree192aead21f0cab7a50d0d5c9ef5518ad3278013c /mrbgems/mruby-symbol-ext/test
parenta6d8df6761a0c84f0cd275a709050c187f60b35f (diff)
parentbb52324bd95628b75925693340577d4390a2c564 (diff)
downloadmruby-a6941101933a06e234f57a180d7119eafa9f1904.tar.gz
mruby-a6941101933a06e234f57a180d7119eafa9f1904.zip
Merge pull request #2089 from ksss/sym-casecmp
Implement Symbol#casecmp
Diffstat (limited to 'mrbgems/mruby-symbol-ext/test')
-rw-r--r--mrbgems/mruby-symbol-ext/test/symbol.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/mrbgems/mruby-symbol-ext/test/symbol.rb b/mrbgems/mruby-symbol-ext/test/symbol.rb
index 35bb31aef..e886a58d7 100644
--- a/mrbgems/mruby-symbol-ext/test/symbol.rb
+++ b/mrbgems/mruby-symbol-ext/test/symbol.rb
@@ -29,6 +29,13 @@ assert("Symbol#upcase") do
assert_equal :HELLO, :hEllO.upcase
end
+assert("Symbol#casecmp") do
+ assert_equal 0, :HELLO.casecmp(:hEllO)
+ assert_equal 1, :HELLO.casecmp(:hEllN)
+ assert_equal -1, :HELLO.casecmp(:hEllP)
+ assert_nil :HELLO.casecmp("hEllO")
+end
+
assert("Symbol#empty?") do
assert_true :''.empty?
end