Decrease the precision of the sec_fraction in the tests

We were using picoseconds as precision but some Ruby implementations
only support up to nanoseconds. Since that much precision was not needed
to test the feature I decreased the precision.
上级 3124007b
......@@ -110,17 +110,17 @@ def test_seconds_until_end_of_day_at_daylight_savings_time_end
end
def test_sec_fraction
time = Time.utc(2016, 4, 23, 0, 0, Rational(1, 10000000000))
assert_equal Rational(1, 10000000000), time.sec_fraction
time = Time.utc(2016, 4, 23, 0, 0, Rational(1, 1_000_000_000))
assert_equal Rational(1, 1_000_000_000), time.sec_fraction
time = Time.utc(2016, 4, 23, 0, 0, 0.0000000001)
assert_equal 0.0000000001.to_r, time.sec_fraction
time = Time.utc(2016, 4, 23, 0, 0, 0.000_000_001)
assert_equal Rational(1, 1_000_000_000), time.sec_fraction
time = Time.utc(2016, 4, 23, 0, 0, 0, Rational(1, 10000))
assert_equal Rational(1, 10000000000), time.sec_fraction
time = Time.utc(2016, 4, 23, 0, 0, 0, Rational(1, 1_000))
assert_equal Rational(1, 1_000_000_000), time.sec_fraction
time = Time.utc(2016, 4, 23, 0, 0, 0, 0.0001)
assert_equal 0.0001.to_r / 1000000, time.sec_fraction
time = Time.utc(2016, 4, 23, 0, 0, 0, 0.001)
assert_equal Rational(1, 1_000_000_000), time.sec_fraction
end
def test_beginning_of_day
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册