1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/test/unit/assertions.rb (assert_equal): use Time#subsec if nsec

is not enough to distinguish arguments.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2009-09-29 13:22:27 +00:00
parent ad8978fdb1
commit 0eddab8404
2 changed files with 15 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Tue Sep 29 22:19:36 2009 Tanaka Akira <akr@fsij.org>
* lib/test/unit/assertions.rb (assert_equal): use Time#subsec if nsec
is not enough to distinguish arguments.
Tue Sep 29 21:16:35 2009 NARUSE, Yui <naruse@ruby-lang.org>
* io.c (rb_scan_open_args): add UTF8-MAC to no-convertion encoding.

View file

@ -67,8 +67,16 @@ module Test
exp_str = "%\#.#{Float::DIG+2}g" % exp
act_str = "%\#.#{Float::DIG+2}g" % act
elsif exp.is_a?(Time) && act.is_a?(Time)
exp_comment = " (nsec=#{exp.nsec})"
act_comment = " (nsec=#{act.nsec})"
if exp.subsec * 1000_000_000 == exp.nsec
exp_comment = " (#{exp.nsec}[ns])"
else
exp_comment = " (subsec=#{exp.subsec})"
end
if act.subsec * 1000_000_000 == act.nsec
act_comment = " (#{act.nsec}[ns])"
else
act_comment = " (subsec=#{act.subsec})"
end
elsif exp.class != act.class
# a subclass of Range, for example.
exp_comment = " (#{exp.class})"