From 8987b97ca9d3eca076a489fbf6eb9c1dfbf72df2 Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 6 Jan 2008 09:25:09 +0000 Subject: * include/ruby/encoding.h (rb_enc_str_buf_cat): declared. * string.c (coderange_scan): extracted from rb_enc_str_coderange. (rb_enc_str_coderange): use coderange_scan. (rb_str_shared_replace): copy encoding and coderange. (rb_enc_str_buf_cat): new function for linear complexity string accumulation with encoding. (rb_str_sub_bang): don't conflict substituted part and replacement. (str_gsub): use rb_enc_str_buf_cat. (rb_str_clear): clear coderange. * re.c (rb_reg_regsub): use rb_enc_str_buf_cat. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_m17n_comb.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'test/ruby/test_m17n_comb.rb') diff --git a/test/ruby/test_m17n_comb.rb b/test/ruby/test_m17n_comb.rb index b1928f3cd5..951961e09b 100644 --- a/test/ruby/test_m17n_comb.rb +++ b/test/ruby/test_m17n_comb.rb @@ -335,7 +335,6 @@ class TestM17NComb < Test::Unit::TestCase end def test_str_aref_substr - combination(STRINGS, STRINGS) {|s1, s2| if s1.ascii_only? || s2.ascii_only? || s1.encoding == s2.encoding t = s1[s2] @@ -1359,7 +1358,7 @@ class TestM17NComb < Test::Unit::TestCase assert_equal(s1, doit.call) next end - if !str_enc_compatible?(s1, s3) + if !str_enc_compatible?(s1.gsub(r2, ''), s3) assert_raise(ArgumentError, desc) { doit.call } next end @@ -1413,7 +1412,7 @@ class TestM17NComb < Test::Unit::TestCase assert_equal([s1, nil], doit.call) next end - if !str_enc_compatible?(s1, s3) + if !str_enc_compatible?(s1.gsub(r2, ''), s3) assert_raise(ArgumentError, desc) { doit.call } next end -- cgit v1.2.1