Skip to content

Commit

Permalink
Added test case to reproduce issue #1311.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasallan committed Dec 8, 2013
1 parent bd40e0f commit 1f587c9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/mri/date/test_date.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,11 @@ def test_freeze
assert_instance_of(String, d.to_s)
end

def test_submillisecond_comparassion
d1 = DateTime.new(2013, 12, 6, 0, 0, Rational(1, 10000))
d2 = DateTime.new(2013, 12, 6, 0, 0, Rational(2, 10000))
# d1 is 0.0001s earlier than d2
assert_equal(-1, d1 <=> d2)
end

end

0 comments on commit 1f587c9

Please sign in to comment.