summaryrefslogtreecommitdiff
path: root/test/ruby/test_optimization.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_optimization.rb')
-rw-r--r--test/ruby/test_optimization.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb
index 23c522612f..1c50044f7f 100644
--- a/test/ruby/test_optimization.rb
+++ b/test/ruby/test_optimization.rb
@@ -313,8 +313,11 @@ class TestRubyOptimization < Test::Unit::TestCase
code = <<-EOF
case foo
when "foo" then :foo
+ when true then true
+ when false then false
when :sym then :sym
when 6 then :fix
+ when nil then nil
when 0.1 then :float
when 0xffffffffffffffff then :big
else
@@ -323,8 +326,11 @@ class TestRubyOptimization < Test::Unit::TestCase
EOF
check = {
'foo' => :foo,
+ true => true,
+ false => false,
:sym => :sym,
6 => :fix,
+ nil => nil,
0.1 => :float,
0xffffffffffffffff => :big,
}
@@ -349,4 +355,11 @@ class TestRubyOptimization < Test::Unit::TestCase
end;
end
end
+
+ def test_eqq
+ [ nil, true, false, 0.1, :sym, 'str', 0xffffffffffffffff ].each do |v|
+ k = v.class.to_s
+ assert_redefine_method(k, '===', "assert_equal(#{v.inspect} === 0, 0)")
+ end
+ end
end