ruby-changes:48875
From: naruse <ko1@a...>
Date: Sun, 3 Dec 2017 21:06:20 +0900 (JST)
Subject: [ruby-changes:48875] naruse:r60993 (trunk): Add test for Bug::String.buf_new
naruse 2017-12-03 21:06:16 +0900 (Sun, 03 Dec 2017) New Revision: 60993 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60993 Log: Add test for Bug::String.buf_new Modified files: trunk/test/-ext-/string/test_external_new.rb Index: test/-ext-/string/test_external_new.rb =================================================================== --- test/-ext-/string/test_external_new.rb (revision 60992) +++ test/-ext-/string/test_external_new.rb (revision 60993) @@ -3,6 +3,12 @@ require 'test/unit' https://github.com/ruby/ruby/blob/trunk/test/-ext-/string/test_external_new.rb#L3 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) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/