source: EcnlProtoTool/trunk/mruby-2.1.1/test/t/symbol.rb@ 439

Last change on this file since 439 was 439, checked in by coas-nagasima, 4 years ago

mrubyを2.1.1に更新

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-ruby;charset=UTF-8
File size: 639 bytes
Line 
1##
2# Symbol ISO Test
3
4assert('Symbol') do
5 assert_equal :"a", :a
6 assert_equal :"a#{1}", :a1
7 assert_equal :'a', :a
8 assert_equal :'a#{1}', :"a\#{1}"
9end
10
11assert('Symbol', '15.2.11') do
12 assert_equal Class, Symbol.class
13end
14
15assert('Symbol#===', '15.2.11.3.1') do
16 assert_true :abc === :abc
17 assert_false :abc === :cba
18end
19
20assert('Symbol#id2name', '15.2.11.3.2') do
21 assert_equal 'abc', :abc.id2name
22end
23
24assert('Symbol#to_s', '15.2.11.3.3') do
25 assert_equal 'abc', :abc.to_s
26end
27
28assert('Symbol#to_sym', '15.2.11.3.4') do
29 assert_equal :abc, :abc.to_sym
30end
31
32assert('Symbol#to_proc') do
33 assert_equal 5, :abs.to_proc[-5]
34end
Note: See TracBrowser for help on using the repository browser.