Skip to content

Commit

Permalink
@fixup Skip tests failing on TruffleRuby
Browse files Browse the repository at this point in the history
  • Loading branch information
andrykonchin committed Jan 10, 2025
1 parent 1f51894 commit c6bc613
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/date/test_date_conv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_to_time__from_datetime
[t.year, t.mon, t.mday, t.hour, t.min, t.sec, t.nsec])
end

unless defined?(::TruffleRuby)
omit_if(RUBY_ENGINE == 'truffleruby', "TruffleRuby does not support more than nanoseconds") do
if Time.allocate.respond_to?(:subsec)
d = DateTime.new(2004, 9, 19, 1, 2, 3, 0) + 456789123456789123.to_r/86400000000000000000000
t = d.to_time.utc
Expand Down
12 changes: 7 additions & 5 deletions test/date/test_date_parse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -589,16 +589,18 @@ def test__parse_odd_offset
end

def test__parse_too_long_year
str = "Jan 1" + "0" * 100_000
h = EnvUtil.timeout(3) {Date._parse(str, limit: 100_010)}
assert_equal(100_000, Math.log10(h[:year]))
assert_equal(1, h[:mon])
omit_if(RUBY_ENGINE == 'truffleruby', "Math.log10 does not support so big numbers like 10^100_000 on TruffleRuby") do
str = "Jan 1" + "0" * 100_000
h = EnvUtil.timeout(3) {Date._parse(str, limit: 100_010)}
assert_equal(100_000, Math.log10(h[:year]))
assert_equal(1, h[:mon])
end

str = "Jan - 1" + "0" * 100_000
h = EnvUtil.timeout(3) {Date._parse(str, limit: 100_010)}
assert_equal(1, h[:mon])
assert_not_include(h, :year)
end unless defined?(::TruffleRuby)
end

require 'time'

Expand Down

0 comments on commit c6bc613

Please sign in to comment.