object_id may not return Fixnum (ISO says Integer), since intptr_t may be...

object_id may not return Fixnum (ISO says Integer), since intptr_t may be bigger than Fixnum, so type check for Numeric; ref #1630
parent 92513747
...@@ -388,7 +388,15 @@ assert('Kernel#object_id', '15.3.1.3.33') do ...@@ -388,7 +388,15 @@ assert('Kernel#object_id', '15.3.1.3.33') do
a = "" a = ""
b = "" b = ""
assert_not_equal a.object_id, b.object_id assert_not_equal a.object_id, b.object_id
assert_not_equal 1.object_id, 1.2.object_id
assert_kind_of Numeric, object_id
assert_kind_of Numeric, "".object_id
assert_kind_of Numeric, true.object_id
assert_kind_of Numeric, false.object_id
assert_kind_of Numeric, nil.object_id
assert_kind_of Numeric, :no.object_id
assert_kind_of Numeric, 1.object_id
assert_kind_of Numeric, 1.0.object_id
end end
# Kernel#p is defined in mruby-print mrbgem. '15.3.1.3.34' # Kernel#p is defined in mruby-print mrbgem. '15.3.1.3.34'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment