summaryrefslogtreecommitdiffhomepage
path: root/test/t/symbol.rb
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2012-05-19 16:14:56 -0700
committerYukihiro "Matz" Matsumoto <[email protected]>2012-05-19 16:14:56 -0700
commitc8b679bf693e0793f8b5ae505517b1d9220d4bfc (patch)
tree5b81dbeda3b6b69167ce8492f3dd770e821316ce /test/t/symbol.rb
parentd0a7b08303606431c0ca27ee1acaae0451e6223f (diff)
parent4a8c740cb6b945150b46530c1aade43fc81009d6 (diff)
downloadmruby-c8b679bf693e0793f8b5ae505517b1d9220d4bfc.tar.gz
mruby-c8b679bf693e0793f8b5ae505517b1d9220d4bfc.zip
Merge pull request #166 from bovi/master
Add Tests for String, Hash, Range and Symbol
Diffstat (limited to 'test/t/symbol.rb')
-rw-r--r--test/t/symbol.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/t/symbol.rb b/test/t/symbol.rb
new file mode 100644
index 000000000..325c8d990
--- /dev/null
+++ b/test/t/symbol.rb
@@ -0,0 +1,23 @@
+##
+# Symbol ISO Test
+
+assert('Symbol', '15.2.11') do
+ Symbol.class == Class
+end
+
+assert('Symbol#===', '15.2.11.3.1') do
+ :abc === :abc and not :abc === :cba
+end
+
+assert('Symbol#id2name', '15.2.11.3.2') do
+ :abc.id2name == 'abc'
+end
+
+assert('Symbol#to_s', '15.2.11.3.3') do
+ :abc.to_s == 'abc'
+end
+
+assert('Symbol#to_sym', '15.2.11.3.4') do
+ :abc.to_sym == :abc
+end
+