summaryrefslogtreecommitdiff
path: root/test/objspace
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-15 08:57:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-15 08:57:01 +0000
commit73768d54d3af644dab3dc3a5fd12aa75961f3c28 (patch)
treef64b946659b54a76d59093e01895052ff2d294bc /test/objspace
parent2a5ddef59feb5b79e097e8b9de1b1f2b3b37b887 (diff)
downloadbundler-73768d54d3af644dab3dc3a5fd12aa75961f3c28.tar.gz
* io.c (argf_type): make typed data.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/objspace')
-rw-r--r--test/objspace/test_objspace.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb
index 3c22dae551..345b00f737 100644
--- a/test/objspace/test_objspace.rb
+++ b/test/objspace/test_objspace.rb
@@ -1,5 +1,6 @@
require "test/unit"
require "objspace"
+require_relative "../ruby/envutil"
class TestObjSpace < Test::Unit::TestCase
def test_memsize_of
@@ -23,6 +24,17 @@ class TestObjSpace < Test::Unit::TestCase
ObjectSpace.memsize_of(//.match("")))
end
+ def test_argf_memsize
+ size = ObjectSpace.memsize_of(ARGF)
+ assert_kind_of(Integer, size)
+ assert_operator(size, :>, 0)
+ argf = ARGF.dup
+ argf.inplace_mode = nil
+ size = ObjectSpace.memsize_of(argf)
+ argf.inplace_mode = "inplace_mode_suffix"
+ assert_equal(size + 20, ObjectSpace.memsize_of(argf))
+ end
+
def test_memsize_of_all
assert_kind_of(Integer, a = ObjectSpace.memsize_of_all)
assert_kind_of(Integer, b = ObjectSpace.memsize_of_all(String))