summaryrefslogtreecommitdiffhomepage
path: root/test/t/kernel.rb
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-01-04 21:12:18 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-01-04 21:12:18 +0900
commitd40a62e2d288cd4a21373d46f83e2615f9e27481 (patch)
tree670342a5fa6244a573ad59cf589c94244100a18c /test/t/kernel.rb
parent925137475cc43cfb4b09aa757251508c29ca349f (diff)
downloadmruby-d40a62e2d288cd4a21373d46f83e2615f9e27481.tar.gz
mruby-d40a62e2d288cd4a21373d46f83e2615f9e27481.zip
object_id may not return Fixnum (ISO says Integer), since intptr_t may be bigger than Fixnum, so type check for Numeric; ref #1630
Diffstat (limited to 'test/t/kernel.rb')
-rw-r--r--test/t/kernel.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/t/kernel.rb b/test/t/kernel.rb
index a78bfe35f..0f8fdebe4 100644
--- a/test/t/kernel.rb
+++ b/test/t/kernel.rb
@@ -388,7 +388,15 @@ assert('Kernel#object_id', '15.3.1.3.33') do
a = ""
b = ""
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
# Kernel#p is defined in mruby-print mrbgem. '15.3.1.3.34'