summaryrefslogtreecommitdiff
path: root/test/ruby/test_m17n_comb.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-02 11:46:40 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-02 11:46:40 +0000
commitbd421aa2d25aa73c83642a8f5af8fa16b794a3b6 (patch)
treed4e528d553256bdef37711ce58dba2705ad3df80 /test/ruby/test_m17n_comb.rb
parent255f43160bf165df350454bdf4dcf72275029704 (diff)
* string.c (rb_str_sub_bang): fix coderange.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_m17n_comb.rb')
-rw-r--r--test/ruby/test_m17n_comb.rb33
1 files changed, 21 insertions, 12 deletions
diff --git a/test/ruby/test_m17n_comb.rb b/test/ruby/test_m17n_comb.rb
index 1ce151d665..05e45d23cf 100644
--- a/test/ruby/test_m17n_comb.rb
+++ b/test/ruby/test_m17n_comb.rb
@@ -115,6 +115,7 @@ class TestM17NComb < Test::Unit::TestCase
def combination(*args, &b)
AllPairs.each(*args, &b)
+ #AllPairs.exhaustive_each(*args, &b)
end
def encdump(str)
@@ -1395,21 +1396,25 @@ class TestM17NComb < Test::Unit::TestCase
[
[
"#{encdump s1}.sub(Regexp.new(#{encdump s2}), #{encdump s3})",
- lambda { s1.sub(r2, s3) }
+ lambda { s1.sub(r2, s3) },
+ false
],
[
"#{encdump s1}.sub(Regexp.new(#{encdump s2}), #{encdump s3})",
- lambda { s1.sub(r2) { s3 } }
+ lambda { s1.sub(r2) { s3 } },
+ false
],
[
"#{encdump s1}.gsub(Regexp.new(#{encdump s2}), #{encdump s3})",
- lambda { s1.gsub(r2, s3) }
+ lambda { s1.gsub(r2, s3) },
+ true
],
[
"#{encdump s1}.gsub(Regexp.new(#{encdump s2}), #{encdump s3})",
- lambda { s1.gsub(r2) { s3 } }
+ lambda { s1.gsub(r2) { s3 } },
+ true
]
- ].each {|desc, doit|
+ ].each {|desc, doit, g|
if !s1.valid_encoding?
assert_raise(ArgumentError, desc) { doit.call }
next
@@ -1422,7 +1427,7 @@ class TestM17NComb < Test::Unit::TestCase
assert_equal(s1, doit.call)
next
end
- if !str_enc_compatible?(s1.gsub(r2, ''), s3)
+ if !str_enc_compatible?(g ? s1.gsub(r2, '') : s1.sub(r2, ''), s3)
assert_raise(Encoding::CompatibilityError, desc) { doit.call }
next
end
@@ -1449,21 +1454,25 @@ class TestM17NComb < Test::Unit::TestCase
[
[
"t=#{encdump s1}.dup;t.sub!(Regexp.new(#{encdump s2}), #{encdump s3})",
- lambda { t=s1.dup; [t, t.sub!(r2, s3)] }
+ lambda { t=s1.dup; [t, t.sub!(r2, s3)] },
+ false
],
[
"t=#{encdump s1}.dup;t.sub!(Regexp.new(#{encdump s2}), #{encdump s3})",
- lambda { t=s1.dup; [t, t.sub!(r2) { s3 }] }
+ lambda { t=s1.dup; [t, t.sub!(r2) { s3 }] },
+ false
],
[
"t=#{encdump s1}.dup;t.gsub!(Regexp.new(#{encdump s2}), #{encdump s3})",
- lambda { t=s1.dup; [t, t.gsub!(r2, s3)] }
+ lambda { t=s1.dup; [t, t.gsub!(r2, s3)] },
+ true
],
[
"t=#{encdump s1}.dup;t.gsub!(Regexp.new(#{encdump s2}), #{encdump s3})",
- lambda { t=s1.dup; [t, t.gsub!(r2) { s3 }] }
+ lambda { t=s1.dup; [t, t.gsub!(r2) { s3 }] },
+ true
]
- ].each {|desc, doit|
+ ].each {|desc, doit, g|
if !s1.valid_encoding?
assert_raise(ArgumentError, desc) { doit.call }
next
@@ -1476,7 +1485,7 @@ class TestM17NComb < Test::Unit::TestCase
assert_equal([s1, nil], doit.call)
next
end
- if !str_enc_compatible?(s1.gsub(r2, ''), s3)
+ if !str_enc_compatible?(g ? s1.gsub(r2, '') : s1.sub(r2, ''), s3)
assert_raise(Encoding::CompatibilityError, desc) { doit.call }
next
end