summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorJean Boussier <byroot@ruby-lang.org>2023-01-30 11:03:50 +0100
committerJean Boussier <jean.boussier@gmail.com>2023-01-30 14:42:40 +0100
commit3f54d09a5b8b6e4fd734abc8911e170d5967b5b0 (patch)
treee26968cc33f4999481ee0331f30f167f87fabd7a /test/ruby
parent4bc343b4365fb4d3755e2f3fa5ac63c16a8cb755 (diff)
bignum.c: rb_int_parse_cstr handle `0` strings
[Bug #19390] We shouldn't check the string length when skipping zeros, as the string might only contains zero characters, resulting in an empty string.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/7196
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_time.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb
index 38c1af6901..2bf6056a49 100644
--- a/test/ruby/test_time.rb
+++ b/test/ruby/test_time.rb
@@ -1426,4 +1426,8 @@ class TestTime < Test::Unit::TestCase
t.deconstruct_keys(%i[year month sec nonexistent])
)
end
+
+ def test_parse_zero_bigint
+ assert_equal 0, Time.new("2020-10-28T16:48:07.000Z").nsec, '[Bug #19390]'
+ end
end