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

modified tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tadf 2012-06-03 05:17:38 +00:00
parent d9dd6f5d35
commit 5dc5a52612
2 changed files with 20 additions and 8 deletions

View file

@ -24,6 +24,18 @@ class TestDateMarshal < Test::Unit::TestCase
assert_equal(d, d2)
assert_equal(d.start, d2.start)
assert_instance_of(String, d2.to_s)
d = Date.today
a = d.marshal_dump
d.freeze
assert(d.frozen?)
assert_raise(RuntimeError){d.marshal_load(a)}
d = DateTime.now
a = d.marshal_dump
d.freeze
assert(d.frozen?)
assert_raise(RuntimeError){d.marshal_load(a)}
end
end

View file

@ -72,19 +72,19 @@ class TestDateStrftime < Test::Unit::TestCase
assert_equal(s[0], d.strftime(f), [f, s].inspect)
case f[-1,1]
when 'c', 'C', 'x', 'X', 'y', 'Y'
f2 = f.sub(/\A%/, '%E')
assert_equal(s[0], d.strftime(f2), [f2, s].inspect)
f2 = f.sub(/\A%/, '%E')
assert_equal(s[0], d.strftime(f2), [f2, s].inspect)
else
f2 = f.sub(/\A%/, '%E')
assert_equal(f2, d.strftime(f2), [f2, s].inspect)
f2 = f.sub(/\A%/, '%E')
assert_equal(f2, d.strftime(f2), [f2, s].inspect)
end
case f[-1,1]
when 'd', 'e', 'H', 'k', 'I', 'l', 'm', 'M', 'S', 'u', 'U', 'V', 'w', 'W', 'y'
f2 = f.sub(/\A%/, '%O')
assert_equal(s[0], d.strftime(f2), [f2, s].inspect)
f2 = f.sub(/\A%/, '%O')
assert_equal(s[0], d.strftime(f2), [f2, s].inspect)
else
f2 = f.sub(/\A%/, '%O')
assert_equal(f2, d.strftime(f2), [f2, s].inspect)
f2 = f.sub(/\A%/, '%O')
assert_equal(f2, d.strftime(f2), [f2, s].inspect)
end
end
end