summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-27 06:10:30 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-27 06:10:30 +0000
commit6f2c904544abc8e6f8762a1fed4d462966bdf374 (patch)
tree381045cf9826a4c0f6f0e1ae3edd04c2871c6b95 /test
parentb9a4340cf2c33ee39f6291c3b0cebbd9cfac2c62 (diff)
downloadruby-6f2c904544abc8e6f8762a1fed4d462966bdf374.tar.gz
ruby-6f2c904544abc8e6f8762a1fed4d462966bdf374.tar.xz
ruby-6f2c904544abc8e6f8762a1fed4d462966bdf374.zip
* re.c (rb_reg_preprocess_dregexp): set encoding as ASCII-8BIT
when /n is specified and the embeded string is escaped text. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_regexp.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb
index 7631b6854..a2911801b 100644
--- a/test/ruby/test_regexp.rb
+++ b/test/ruby/test_regexp.rb
@@ -287,6 +287,7 @@ class TestRegexp < Test::Unit::TestCase
def test_unescape
assert_raise(ArgumentError) { s = '\\'; /#{ s }/ }
+ assert_equal(/\xFF/n, /#{ s="\\xFF" }/n)
assert_equal(/\177/, (s = '\177'; /#{ s }/))
assert_raise(ArgumentError) { s = '\u'; /#{ s }/ }
assert_raise(ArgumentError) { s = '\u{ ffffffff }'; /#{ s }/ }