summaryrefslogtreecommitdiff
path: root/test/ruby/test_file_exhaustive.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_file_exhaustive.rb')
-rw-r--r--test/ruby/test_file_exhaustive.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index 2c945eac62..bd69addef6 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -458,6 +458,15 @@ class TestFileExhaustive < Test::Unit::TestCase
end
end
+ def test_expand_path_memsize
+ bug9934 = '[ruby-core:63114] [Bug #9934]'
+ require "objspace"
+ path = File.expand_path("/foo")
+ assert_operator(ObjectSpace.memsize_of(path), :<=, path.bytesize, bug9934)
+ path = File.expand_path("/a"*25)
+ assert_equal(path.bytesize+1, ObjectSpace.memsize_of(path), bug9934)
+ end
+
def test_expand_path_encoding
drive = (DRIVE ? 'C:' : '')
if Encoding.find("filesystem") == Encoding::CP1251