mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
		
			
				
	
	
		
			17 lines
		
	
	
	
		
			534 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
	
		
			534 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
# frozen_string_literal: false
 | 
						|
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)
 | 
						|
    end
 | 
						|
  end
 | 
						|
end
 |