diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-13 04:29:31 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-13 04:29:31 +0000 |
commit | 0fa71d44d505daf60bf8d4539ef4548207ba4002 (patch) | |
tree | cd82f2983b988e552ac596546de846fcda8a4448 /test/date/test_date_marshal.rb | |
parent | 8655d0735fe08a38b290d7b83c2f9c9901800544 (diff) | |
download | ruby-0fa71d44d505daf60bf8d4539ef4548207ba4002.tar.gz |
date_core.c: respect COMPLEX_DAT bit
* ext/date/date_core.c (d_lite_marshal_load): respect COMPLEX_DAT
bit in the pre-allocated structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/date/test_date_marshal.rb')
-rw-r--r-- | test/date/test_date_marshal.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/date/test_date_marshal.rb b/test/date/test_date_marshal.rb index 24622bd4b9..c7ce737aac 100644 --- a/test/date/test_date_marshal.rb +++ b/test/date/test_date_marshal.rb @@ -41,4 +41,12 @@ class TestDateMarshal < Test::Unit::TestCase assert_raise(expected_error){d.marshal_load(a)} end + def test_memsize + require 'objspace' + t = DateTime.new(2018, 11, 13) + size = ObjectSpace.memsize_of(t) + t2 = Marshal.load(Marshal.dump(t)) + assert_equal(t, t2) + assert_equal(size, ObjectSpace.memsize_of(t2), "not reallocated but memsize changed") + end end |