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

* test/wsdl/datetime/test_datetime.rb: fixed a stupid testcase which

dumps "E" at month-end.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nahi 2004-01-08 07:55:00 +00:00
parent 973c2ad00d
commit d69d6b6c36
2 changed files with 24 additions and 17 deletions

View file

@ -1,3 +1,8 @@
Thu Jan 8 16:51:04 2004 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp>
* test/wsdl/datetime/test_datetime.rb: fixed a stupid testcase which
dumps "E" at month-end.
Thu Jan 8 11:20:01 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* eval.c, object.c, process.c, re.c: don't use C++ style comments.

View file

@ -58,28 +58,30 @@ class TestDatetime < Test::Unit::TestCase
end
def test_datetime
d1 = DateTime.now
d2 = @client.now(d1)
assert_equal(d2.year, d1.year)
assert_equal(d2.month, d1.month)
assert_equal(d2.day, d1.day + 1)
assert_equal(d2.hour, d1.hour)
assert_equal(d2.min, d1.min)
assert_equal(d2.sec, d1.sec)
assert_equal(d2.sec, d1.sec)
d = DateTime.now
d1 = d + 1
d2 = @client.now(d)
assert_equal(d1.year, d2.year)
assert_equal(d1.month, d2.month)
assert_equal(d1.day, d2.day)
assert_equal(d1.hour, d2.hour)
assert_equal(d1.min, d2.min)
assert_equal(d1.sec, d2.sec)
assert_equal(d1.sec, d2.sec)
end
def test_time
d = DateTime.now
t = Time.gm(d.year, d.month, d.day, d.hour, d.min, d.sec)
d2 = d + 1
t2 = @client.now(t)
assert_equal(d2.year, t2.year)
assert_equal(d2.month, t2.month)
assert_equal(d2.day, t2.day)
assert_equal(d2.hour, t2.hour)
assert_equal(d2.min, t2.min)
assert_equal(d2.sec, t2.sec)
d1 = d + 1
d2 = @client.now(t)
assert_equal(d1.year, d2.year)
assert_equal(d1.month, d2.month)
assert_equal(d1.day, d2.day)
assert_equal(d1.hour, d2.hour)
assert_equal(d1.min, d2.min)
assert_equal(d1.sec, d2.sec)
assert_equal(d1.sec, d2.sec)
end
end