diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-05 12:33:55 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-05 12:33:55 +0000 |
| commit | b8f7a25f992450881ec9d848e7dba6da1820e9fd (patch) | |
| tree | 7a3b1dd36b5abe16b014b90885b756ff9335a8bd /test/ruby | |
| parent | 20979f2031a3f49e03bf103b4bd06b65c7eb9141 (diff) | |
| download | ruby-b8f7a25f992450881ec9d848e7dba6da1820e9fd.tar.gz ruby-b8f7a25f992450881ec9d848e7dba6da1820e9fd.tar.xz ruby-b8f7a25f992450881ec9d848e7dba6da1820e9fd.zip | |
test_str_slice! refactored.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_m17n_comb.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/ruby/test_m17n_comb.rb b/test/ruby/test_m17n_comb.rb index 44e7eeff2..33f67cf0b 100644 --- a/test/ruby/test_m17n_comb.rb +++ b/test/ruby/test_m17n_comb.rb @@ -1122,6 +1122,8 @@ class TestM17NComb < Test::Unit::TestCase def test_str_slice! each_slice_call {|s, *args| + desc_slice = "#{encdump s}.slice#{encdumpargs args}" + desc_slice_bang = "#{encdump s}.slice!#{encdumpargs args}" t = s.dup begin r = t.slice!(*args) @@ -1129,14 +1131,14 @@ class TestM17NComb < Test::Unit::TestCase e = $! end if e - assert_raise(e.class, "#{encdump s}.slice#{encdumpargs args}") { s.slice(*args) } + assert_raise(e.class, desc_slice) { s.slice(*args) } next end if !r - assert_nil(s.slice(*args)) + assert_nil(s.slice(*args), desc_slice) next end - assert_equal(s.slice(*args), r) + assert_equal(s.slice(*args), r, desc_slice_bang) assert_equal(s.bytesize, r.bytesize + t.bytesize) if args.length == 1 && String === args[0] assert_equal(args[0].encoding, r.encoding, |
