summaryrefslogtreecommitdiffhomepage
path: root/test/t/symbol.rb
blob: b0252849d67eb41f65d355cf4c7b29ef7e0f2000 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
##
# Symbol ISO Test

assert('Symbol', '15.2.11') do
  assert_equal Class, Symbol.class
end

assert('Symbol#===', '15.2.11.3.1') do
  assert_true :abc == :abc
  assert_false :abc == :cba
end

assert('Symbol#id2name', '15.2.11.3.2') do
  assert_equal 'abc', :abc.id2name
end

assert('Symbol#to_s', '15.2.11.3.3') do
  assert_equal  'abc', :abc.to_s
end

assert('Symbol#to_sym', '15.2.11.3.4') do
  assert_equal :abc, :abc.to_sym
end