summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-03 09:31:13 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-03 09:31:13 +0000
commit7ad29955a6afbe8ce03eeee376be2bfa792cd198 (patch)
tree4ad8294343fb6687af38e92a1601b1528245d806
parent227609ea96356debda538a6c6bb2cef3d3119602 (diff)
* test/date/test_date.rb (TestDate#test_coerce):
test for [ruby-core:35127]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--test/date/test_date.rb21
2 files changed, 26 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 53db59943c..626e5efd02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue May 3 18:23:57 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * test/date/test_date.rb (TestDate#test_coerce):
+ test for [ruby-core:35127].
+
Tue May 3 04:27:53 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* thread.c (rb_thread_select): preserve errno if no error
diff --git a/test/date/test_date.rb b/test/date/test_date.rb
index 86790e4cde..2c30e6483b 100644
--- a/test/date/test_date.rb
+++ b/test/date/test_date.rb
@@ -113,6 +113,27 @@ class TestDate < Test::Unit::TestCase
assert_equal(d2, dt2)
end
+ def test_coerce
+ bug4375 = '[ruby-core:35127]'
+ d = Date.jd(0)
+ d2 = Date.jd(1)
+ others = [1, d2, Date::Infinity.new, nil, Object.new]
+ assert_nothing_raised(bug4375) {
+ others.each do |o|
+ case o
+ when d
+ flunk("expected not to match")
+ end
+ end
+ }
+ assert_nothing_raised(bug4375) {
+ case d
+ when *others
+ flunk("expected not to match")
+ end
+ }
+ end
+
def test_hash
h = {}
h[Date.new(1999,5,23)] = 0