diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index 8718dbc327..d7e736de3a 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -109,21 +109,21 @@ class TestTime < Test::Unit::TestCase end def test_at - assert_equal(100000, Time.at("0.1").usec) - assert_equal(10000, Time.at("0.01").usec) - assert_equal(1000, Time.at("0.001").usec) - assert_equal(100, Time.at("0.0001").usec) - assert_equal(10, Time.at("0.00001").usec) - assert_equal(1, Time.at("0.000001").usec) - assert_equal(100000000, Time.at("0.1").nsec) - assert_equal(10000000, Time.at("0.01").nsec) - assert_equal(1000000, Time.at("0.001").nsec) - assert_equal(100000, Time.at("0.0001").nsec) - assert_equal(10000, Time.at("0.00001").nsec) - assert_equal(1000, Time.at("0.000001").nsec) - assert_equal(100, Time.at("0.0000001").nsec) - assert_equal(10, Time.at("0.00000001").nsec) - assert_equal(1, Time.at("0.000000001").nsec) + assert_equal(100000, Time.at("0.1".to_r).usec) + assert_equal(10000, Time.at("0.01".to_r).usec) + assert_equal(1000, Time.at("0.001".to_r).usec) + assert_equal(100, Time.at("0.0001".to_r).usec) + assert_equal(10, Time.at("0.00001".to_r).usec) + assert_equal(1, Time.at("0.000001".to_r).usec) + assert_equal(100000000, Time.at("0.1".to_r).nsec) + assert_equal(10000000, Time.at("0.01".to_r).nsec) + assert_equal(1000000, Time.at("0.001".to_r).nsec) + assert_equal(100000, Time.at("0.0001".to_r).nsec) + assert_equal(10000, Time.at("0.00001".to_r).nsec) + assert_equal(1000, Time.at("0.000001".to_r).nsec) + assert_equal(100, Time.at("0.0000001".to_r).nsec) + assert_equal(10, Time.at("0.00000001".to_r).nsec) + assert_equal(1, Time.at("0.000000001".to_r).nsec) assert_equal(100000, Time.at(0.1).usec) assert_equal(10000, Time.at(0.01).usec) assert_equal(1000, Time.at(0.001).usec)