summaryrefslogtreecommitdiff
path: root/test/-ext-/string
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-03 12:06:16 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-03 12:06:16 +0000
commit7a96d788dc0be2efc26ece2dec9221257339e677 (patch)
treebb20385b16ea9b6631a7bca2d3ede3f30fe405ba /test/-ext-/string
parent476f9b638895f1550e75552c49ef169ef1adc008 (diff)
Add test for Bug::String.buf_new
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/-ext-/string')
-rw-r--r--test/-ext-/string/test_external_new.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/-ext-/string/test_external_new.rb b/test/-ext-/string/test_external_new.rb
index f7c7908..f8ee773 100644
--- a/test/-ext-/string/test_external_new.rb
+++ b/test/-ext-/string/test_external_new.rb
@@ -3,6 +3,12 @@ require 'test/unit'
require '-test-/string'
class Test_StringExternalNew < Test::Unit::TestCase
+ def test_buf_new
+ assert_operator(0, :<=, Bug::String.capacity(Bug::String.buf_new(0)))
+ assert_operator(127, :<=, Bug::String.capacity(Bug::String.buf_new(127)))
+ assert_operator(128, :<=, Bug::String.capacity(Bug::String.buf_new(128)))
+ end
+
def test_external_new_with_enc
Encoding.list.each do |enc|
assert_equal(enc, Bug::String.external_new(0, enc).encoding)