Skip to content
Browse files

add test cases for convert to string for minus numbers

  • Loading branch information...
1 parent 7ad6aac commit 16de510aa43150da061f987dcc614a92abe6eeee @kachick committed
Showing with 8 additions and 0 deletions.
  1. +8 −0 test/test_integer-base.rb
View
8 test/test_integer-base.rb
@@ -57,6 +57,14 @@ def test_to_s
assert_equal('11', 3.to_s(%w[0 1]))
assert_equal('100', 4.to_s(%w[0 1]))
assert_equal('101', 5.to_s(%w[0 1]))
+
+ assert_equal('-aib', -192.to_s(['0', *'A'..'I']))
+ assert_equal('0', 0.to_s(%w[0 1]))
+ assert_equal('-1', -1.to_s(%w[0 1]))
+ assert_equal('-10', -2.to_s(%w[0 1]))
+ assert_equal('-11', -3.to_s(%w[0 1]))
+ assert_equal('-100', -4.to_s(%w[0 1]))
+ assert_equal('-101', -5.to_s(%w[0 1]))
end
def test_binary

0 comments on commit 16de510

Please sign in to comment.
Something went wrong with that request. Please try again.