summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-08 09:33:00 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-08 09:33:00 +0000
commit6a80859a161de8606d2eca289807c05d8f57dee1 (patch)
tree5e6c2a49bbdc5cc54f00aa2776dbad97d705f9be /test
parent3de31e69edf7f509e4907842435add124893ecfc (diff)
merge revision(s) 28192:
* regexp.c (re_compile_pattern): allow zero times match for non-greedy range repeatation. [ruby-core:30613] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@28224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_regexp.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb
index 52ac5f5324..93ffb17ec4 100644
--- a/test/ruby/test_regexp.rb
+++ b/test/ruby/test_regexp.rb
@@ -457,4 +457,9 @@ class TestRegexp < Test::Unit::TestCase
assert_equal("1", $1)
assert_equal(" " * 4999999, $2)
end
+
+ def test_range_greedy
+ /wo{0,3}?/ =~ "woo"
+ assert_equal("w", $&)
+ end
end