mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* re.c (rb_reg_initialize_str): forbid raw non ASCII character
for ASCII-8BIT regexp in non ASCII-8BIT script. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8987b97ca9
commit
f38cc001a7
3 changed files with 17 additions and 2 deletions
|
@ -320,6 +320,8 @@ class TestM17N < Test::Unit::TestCase
|
|||
assert_regexp_fixed_ascii8bit(eval(a(%{/\xc2\xa1/n})))
|
||||
assert_regexp_fixed_ascii8bit(eval(a(%q{/\xc2\xa1/})))
|
||||
|
||||
assert_raise(SyntaxError) { eval("/\xa1\xa1/n".force_encoding("euc-jp")) }
|
||||
|
||||
[/\xc2\xa1/n, eval(a(%{/\xc2\xa1/})), eval(a(%{/\xc2\xa1/n}))].each {|r|
|
||||
assert_equal(nil, r =~ a("a"))
|
||||
assert_equal(nil, r =~ e("a"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue