summaryrefslogtreecommitdiffhomepage
path: root/test/t/integer.rb
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-03-04 11:56:40 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-03-04 11:56:40 +0900
commit6b6277e2c6f24f66c021df345631e7d69ea13056 (patch)
treecf6fca44da7242118a618dad08a12bb88fcd0847 /test/t/integer.rb
parenta3411c4c96c5975680b7198364127b19472cb20a (diff)
parent6e1f4695aa05dbd9c5536b3d1479f67c63b9a86c (diff)
downloadmruby-6b6277e2c6f24f66c021df345631e7d69ea13056.tar.gz
mruby-6b6277e2c6f24f66c021df345631e7d69ea13056.zip
Merge pull request #1790 from iij/pr-float-divmod
fix Float#divmod returns nil
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 = []