1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* re.c (rb_reg_initialize_m): specify ARG_ENCODING_NONE instead of

ARG_ENCODING_FIXED for Regexp.new("", nil, "n").  [ruby-dev:36761]

* test/ruby/test_regexp.rb (TestRegexp#test_initialize): test
  updated.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-10-18 10:29:06 +00:00
parent 7adbfbb793
commit fcce99c52d
3 changed files with 11 additions and 2 deletions

View file

@ -272,8 +272,9 @@ class TestRegexp < Test::Unit::TestCase
Thread.new { $SAFE = 4; re.instance_eval { initialize(re) } }.join
end
assert_equal(Encoding.find("ASCII-8BIT"), Regexp.new("b..", nil, "n").encoding)
assert_equal(Encoding.find("US-ASCII"), Regexp.new("b..", nil, "n").encoding)
assert_equal("bar", "foobarbaz"[Regexp.new("b..", nil, "n")])
assert_equal(//n, Regexp.new("", nil, "n"))
assert_raise(RegexpError) { Regexp.new(")(") }
end