summaryrefslogtreecommitdiff
path: root/test/-ext-/string/test_capacity.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/-ext-/string/test_capacity.rb')
-rw-r--r--test/-ext-/string/test_capacity.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/-ext-/string/test_capacity.rb b/test/-ext-/string/test_capacity.rb
index 50f8c10f58..2c6c51fdda 100644
--- a/test/-ext-/string/test_capacity.rb
+++ b/test/-ext-/string/test_capacity.rb
@@ -23,7 +23,7 @@ class Test_StringCapacity < Test::Unit::TestCase
def test_s_new_capacity
assert_equal("", String.new(capacity: 1000))
assert_equal(String, String.new(capacity: 1000).class)
- assert_equal(10000, capa(String.new(capacity: 10000)))
+ assert_equal(10_000 - 1, capa(String.new(capacity: 10_000))) # Real capa doesn't account for termlen
assert_equal("", String.new(capacity: -1000))
assert_equal(capa(String.new(capacity: -10000)), capa(String.new(capacity: -1000)))
@@ -66,7 +66,7 @@ class Test_StringCapacity < Test::Unit::TestCase
end
def embed_header_size
- 2 * RbConfig::SIZEOF['void*'] + RbConfig::SIZEOF['long']
+ 3 * RbConfig::SIZEOF['void*']
end
def max_embed_len