diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-06 02:17:18 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-06 02:17:18 +0000 |
| commit | 3cffda3ae79531e6cabbc98a9b844fdbf57573a1 (patch) | |
| tree | 96aca312d72f0ff0c510c73106556b2e46198852 /test/ruby | |
| parent | c0c7b7c0475f5803d2e74f6390cad3ca6a90d737 (diff) | |
| download | ruby-3cffda3ae79531e6cabbc98a9b844fdbf57573a1.tar.gz ruby-3cffda3ae79531e6cabbc98a9b844fdbf57573a1.tar.xz ruby-3cffda3ae79531e6cabbc98a9b844fdbf57573a1.zip | |
add a test.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_m17n.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb index 5d5b183c6..590b22f18 100644 --- a/test/ruby/test_m17n.rb +++ b/test/ruby/test_m17n.rb @@ -721,6 +721,13 @@ class TestM17N < Test::Unit::TestCase s = "abc".force_encoding(Encoding::ASCII_8BIT) t = s.gsub(/b/, "\xa1\xa1".force_encoding("euc-jp")) assert_equal(Encoding::ASCII_8BIT, s.encoding) + + assert_raise(ArgumentError) { + "abc".gsub(/[ac]/) { + $& == "a" ? "\xc2\xa1".force_encoding("euc-jp") : + "\xc2\xa1".force_encoding("utf-8") + } + } end def test_regexp_match |
