diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-07 02:49:01 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-07 02:49:01 +0000 |
commit | 063beac3436cb94bf51cb9fec08b34e977563faa (patch) | |
tree | 1fa0a156e8ce6f20d43ea627e0cb847bcb8f8982 /test/ruby/test_m17n.rb | |
parent | fa21f1b7510dba084b907a6189a67f36d36a5008 (diff) | |
download | ruby-063beac3436cb94bf51cb9fec08b34e977563faa.tar.gz |
* encoding.c (rb_enc_internal_get_index): extracted from
rb_enc_get_index.
(rb_enc_internal_set_index): extracted from rb_enc_associate_index
* include/ruby/encoding.h (ENCODING_SET): work over ENCODING_INLINE_MAX.
(ENCODING_GET): ditto.
(ENCODING_IS_ASCII8BIT): defined.
(ENCODING_CODERANGE_SET): defined.
* re.c (rb_reg_fixed_encoding_p): use ENCODING_IS_ASCII8BIT.
* string.c (rb_enc_str_buf_cat): use ENCODING_IS_ASCII8BIT.
* parse.y (reg_fragment_setenc_gen): use ENCODING_IS_ASCII8BIT.
* marshal.c (has_ivars): use ENCODING_IS_ASCII8BIT.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_m17n.rb')
-rw-r--r-- | test/ruby/test_m17n.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb index b15bcfdf10..32415683b6 100644 --- a/test/ruby/test_m17n.rb +++ b/test/ruby/test_m17n.rb @@ -370,6 +370,15 @@ class TestM17N < Test::Unit::TestCase assert_regexp_fixed_sjis(eval(s(%q{/\xc2\xa1/}))) end + def test_regexp_windows_31j + begin + Regexp.new("\xa1".force_encoding("windows-31j")) =~ "\xa1\xa1".force_encoding("euc-jp") + rescue ArgumentError + err = $! + end + assert_match(/windows-31j/i, err.message) + end + def test_regexp_embed r = eval(e("/\xc2\xa1/")) assert_raise(ArgumentError) { eval(s("/\xc2\xa1\#{r}/s")) } |