ruby-changes:12811
From: naruse <ko1@a...>
Date: Fri, 14 Aug 2009 18:08:37 +0900 (JST)
Subject: [ruby-changes:12811] Ruby:r24539 (trunk): * re.c (rb_reg_preprocess_dregexp): change Exception class to
naruse 2009-08-14 18:05:44 +0900 (Fri, 14 Aug 2009) New Revision: 24539 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24539 Log: * re.c (rb_reg_preprocess_dregexp): change Exception class to RegexpError. * test/ruby/test_m17n.rb (test_regexp_usascii): follow above. * test/ruby/test_m17n.rb (test_regexp_embed): ditto. Modified files: trunk/ChangeLog trunk/re.c trunk/test/ruby/test_m17n.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 24538) +++ ChangeLog (revision 24539) @@ -1,3 +1,12 @@ +Fri Aug 14 17:59:12 2009 NARUSE, Yui <naruse@r...> + + * re.c (rb_reg_preprocess_dregexp): change Exception class to + RegexpError. + + * test/ruby/test_m17n.rb (test_regexp_usascii): follow above. + + * test/ruby/test_m17n.rb (test_regexp_embed): ditto. + Fri Aug 14 17:17:42 2009 NARUSE, Yui <naruse@r...> * enc/Makefile.in (MKDIRS): revert r24525. Index: re.c =================================================================== --- re.c (revision 24538) +++ re.c (revision 24539) @@ -2301,7 +2301,7 @@ if (fixed_enc != 0) { if (regexp_enc != 0 && regexp_enc != fixed_enc) { - rb_raise(rb_eArgError, "encoding mismatch in dynamic regexp : %s and %s", + rb_raise(rb_eRegexpError, "encoding mismatch in dynamic regexp : %s and %s", rb_enc_name(regexp_enc), rb_enc_name(fixed_enc)); } regexp_enc = fixed_enc; Index: test/ruby/test_m17n.rb =================================================================== --- test/ruby/test_m17n.rb (revision 24538) +++ test/ruby/test_m17n.rb (revision 24539) @@ -442,18 +442,18 @@ def test_regexp_embed r = eval(e("/\xc2\xa1/")) - assert_raise(ArgumentError) { eval(s("/\xc2\xa1\#{r}/s")) } - assert_raise(ArgumentError) { eval(s("/\#{r}\xc2\xa1/s")) } + assert_raise(RegexpError) { eval(s("/\xc2\xa1\#{r}/s")) } + assert_raise(RegexpError) { eval(s("/\#{r}\xc2\xa1/s")) } r = /\xc2\xa1/e - assert_raise(ArgumentError) { eval(s("/\xc2\xa1\#{r}/s")) } - assert_raise(ArgumentError) { eval(s("/\#{r}\xc2\xa1/s")) } + assert_raise(RegexpError) { eval(s("/\xc2\xa1\#{r}/s")) } + assert_raise(RegexpError) { eval(s("/\#{r}\xc2\xa1/s")) } r = eval(e("/\xc2\xa1/")) - assert_raise(ArgumentError) { /\xc2\xa1#{r}/s } + assert_raise(RegexpError) { /\xc2\xa1#{r}/s } r = /\xc2\xa1/e - assert_raise(ArgumentError) { /\xc2\xa1#{r}/s } + assert_raise(RegexpError) { /\xc2\xa1#{r}/s } r1 = Regexp.new('foo'.force_encoding("ascii-8bit")) r2 = eval('/bar#{r1}/'.force_encoding('ascii-8bit')) @@ -1255,7 +1255,7 @@ assert_regexp_usascii_literal('/\u1234#{%q"\x80"}/', nil, SyntaxError) assert_regexp_usascii_literal('/\u1234#{"\x80"}/', nil, SyntaxError) assert_regexp_usascii_literal('/\u1234\x80/', nil, SyntaxError) - assert_regexp_usascii_literal('/\u1234#{}\x80/', nil, ArgumentError) + assert_regexp_usascii_literal('/\u1234#{}\x80/', nil, RegexpError) end def test_gbk -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/