Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: ruby/ruby
...
head fork: headius/ruby
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 9 additions and 0 deletions.
  1. +9 −0 test/date/test_date.rb
View
9 test/date/test_date.rb
@@ -141,4 +141,13 @@ def test_freeze
assert_instance_of(String, d.to_s)
end
+ def test_submillisecond_comparison
+ 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)
+ assert_equal(0, d1 <=> d1)
+ assert_equal(1, d2 <=> d1)
+ end
+
end

No commit comments for this range

Something went wrong with that request. Please try again.