diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-14 00:50:19 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-14 00:50:19 +0000 |
commit | 9d5681ad972f00dfdf4a375575dc04ae18f930e7 (patch) | |
tree | 49d3b966eeee24756a3a41191f98a2db066b7f87 /test/ruby | |
parent | 588c13973ae796a8953a9983a4d7ee5c7ecb4d8e (diff) |
merge revision(s) 39766,39769: [Backport #8101]
* 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/branches/ruby_1_9_3@40711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_time.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index 961c49432c..6428e3452c 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -378,6 +378,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 assert_equal(T2000, T2000.dup) assert_raise(TypeError) do |