summaryrefslogtreecommitdiffhomepage
path: root/test/t/integer.rb
diff options
context:
space:
mode:
authorTomoyuki Sahara <[email protected]>2014-03-04 10:51:56 +0900
committerTomoyuki Sahara <[email protected]>2014-03-04 10:51:56 +0900
commit6e1f4695aa05dbd9c5536b3d1479f67c63b9a86c (patch)
treecf6fca44da7242118a618dad08a12bb88fcd0847 /test/t/integer.rb
parent9686890ab3987dae5a0f3f9422941d2551bcebf9 (diff)
downloadmruby-6e1f4695aa05dbd9c5536b3d1479f67c63b9a86c.tar.gz
mruby-6e1f4695aa05dbd9c5536b3d1479f67c63b9a86c.zip
add tests for Integer#divmod.
Diffstat (limited to 'test/t/integer.rb')
-rw-r--r--test/t/integer.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/t/integer.rb b/test/t/integer.rb
index 79ee1e790..2bffce5a9 100644
--- a/test/t/integer.rb
+++ b/test/t/integer.rb
@@ -207,6 +207,16 @@ end
# Not ISO specified
+assert('Integer#divmod') do
+ assert_equal [ 0, 0], 0.divmod(1)
+ assert_equal [ 0, 1], 1.divmod(3)
+ assert_equal [ 3, 0], 3.divmod(1)
+ assert_equal [ 2, 6], 20.divmod(7)
+ assert_equal [-1, 2], -3.divmod(5)
+ assert_equal [-2, -1], 25.divmod(-13)
+ assert_equal [ 1, -6], -13.divmod(-7)
+end
+
assert('Integer#step') do
a = []
b = []