diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-11-30 09:25:14 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-11-30 09:25:14 +0000 |
| commit | e72fbb7b2104fb27c7255d46338cf79354fea00b (patch) | |
| tree | b3e6fcfe5696c26aab078839e781e7a4e9b8d90e /test | |
| parent | bd2e41a34e83408e382be1b2fb6a8389176b1210 (diff) | |
| download | ruby-e72fbb7b2104fb27c7255d46338cf79354fea00b.tar.gz ruby-e72fbb7b2104fb27c7255d46338cf79354fea00b.tar.xz ruby-e72fbb7b2104fb27c7255d46338cf79354fea00b.zip | |
merges r20391 and r20398 from trunk into ruby_1_9_1.
* regparse.c (is_invalid_quantifier_target): Perl and old Ruby
accepts quantifier on anchors. [ruby-core:20161]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
| -rw-r--r-- | test/ruby/test_regexp.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb index fdfef04b4..d6441c957 100644 --- a/test/ruby/test_regexp.rb +++ b/test/ruby/test_regexp.rb @@ -604,11 +604,13 @@ class TestRegexp < Test::Unit::TestCase check(/\Aa{0}+\z/, "", %w(a aa aab)) check(/\Aa{1}+\z/, %w(a aa), ["", "aab"]) check(/\Aa{1,2}b{1,2}\z/, %w(ab aab abb aabb), ["", "aaabb", "abbb"]) + check(/(?!x){0,1}/, [ ['', 'ab'], ['', ''] ]) + check(/c\z{0,1}/, [ ['c', 'abc'], ['c', 'cab']], ['abd']) + check(/\A{0,1}a/, [ ['a', 'abc'], ['a', '____abc']], ['bcd']) failcheck('.{100001}') failcheck('.{0,100001}') failcheck('.{1,0}') failcheck('{0}') - failcheck('(?!x){0,1}') end def test_parse_comment |
