summaryrefslogtreecommitdiffstats
path: root/test/ruby/test_bignum.rb
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-03-22 01:28:23 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-03-22 01:28:23 +0000
commit27ba846a05674be1c756919d9a9c82b1f56b31e7 (patch)
tree4a4c8e2ee11358423cc80917fc35d5ec47d21a7a /test/ruby/test_bignum.rb
parent5cb2a90c633cb8fb80baf3cb512b797607a5c396 (diff)
downloadruby-27ba846a05674be1c756919d9a9c82b1f56b31e7.tar.gz
ruby-27ba846a05674be1c756919d9a9c82b1f56b31e7.tar.xz
ruby-27ba846a05674be1c756919d9a9c82b1f56b31e7.zip
* test/ruby/test_bignum.rb (test_to_s): add tests for Bignum#to_s.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_bignum.rb')
-rw-r--r--test/ruby/test_bignum.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb
index c238337db..48e8d9a92 100644
--- a/test/ruby/test_bignum.rb
+++ b/test/ruby/test_bignum.rb
@@ -84,4 +84,15 @@ class TestBignum < Test::Unit::TestCase
shift_test(-4518325415524767873)
shift_test(-0xfffffffffffffffff)
end
+
+ def test_to_s # [ruby-core:10686]
+ assert_equal("fvvvvvvvvvvvv" ,18446744073709551615.to_s(32))
+ assert_equal("g000000000000" ,18446744073709551616.to_s(32))
+ assert_equal("3w5e11264sgsf" ,18446744073709551615.to_s(36))
+ assert_equal("3w5e11264sgsg" ,18446744073709551616.to_s(36))
+ assert_equal("nd075ib45k86f" ,18446744073709551615.to_s(31))
+ assert_equal("nd075ib45k86g" ,18446744073709551616.to_s(31))
+ assert_equal("1777777777777777777777" ,18446744073709551615.to_s(8))
+ assert_equal("-1777777777777777777777" ,-18446744073709551615.to_s(8))
+ end
end