summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-15 14:06:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-15 14:06:21 +0000
commit84085167f813294250a5e45b8584bcd8aa009ecd (patch)
treea7c69fd70a35b777ccf52af4b683e4f9314199ef /test/ruby
parent55549b85f19a518a65a16918829a0c8f6480c78f (diff)
time.c: check re-initialize
* time.c (GetTimeval): check if already initialized instance. * time.c (GetNewTimeval): check if newly created instance. * time.c (time_init_0, time_init_1, time_init_copy, time_mload): must be newly created instance. [ruby-core:53436] [Bug #8099] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_time.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb
index ca2b638e2d..15b6ae5bef 100644
--- a/test/ruby/test_time.rb
+++ b/test/ruby/test_time.rb
@@ -408,6 +408,15 @@ class TestTime < Test::Unit::TestCase
assert_kind_of(Integer, t2000.hash)
end
+ def test_reinitialize
+ bug8099 = '[ruby-core:53436] [Bug #8099]'
+ t2000 = get_t2000
+ assert_raise(TypeError, bug8099) {
+ t2000.send(:initialize, 2013, 03, 14)
+ }
+ assert_equal(get_t2000, t2000, bug8099)
+ end
+
def test_init_copy
t2000 = get_t2000
assert_equal(t2000, t2000.dup)