diff options
| author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-26 08:44:57 +0000 |
|---|---|---|
| committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-26 08:44:57 +0000 |
| commit | 1578fc640ddf7577d34706449cbaa4161943ae8b (patch) | |
| tree | 2c31f12bc46f04362051c1415ee1f565e3ce17eb /test/strscan | |
| parent | e08bd9d9b82d7aafbc8b3df6454172b6110decf3 (diff) | |
| download | ruby-1578fc640ddf7577d34706449cbaa4161943ae8b.tar.gz ruby-1578fc640ddf7577d34706449cbaa4161943ae8b.tar.xz ruby-1578fc640ddf7577d34706449cbaa4161943ae8b.zip | |
* ext/strscan/strscan.c (strscan_do_scan): StringScanner.new("").scan(//) should return "". [ruby-Bugs:4361]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/strscan')
| -rw-r--r-- | test/strscan/test_stringscanner.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/strscan/test_stringscanner.rb b/test/strscan/test_stringscanner.rb index deb05d29a..5b0fd53c7 100644 --- a/test/strscan/test_stringscanner.rb +++ b/test/strscan/test_stringscanner.rb @@ -242,6 +242,11 @@ class TestStringScanner < Test::Unit::TestCase s.string.replace '' # unspecified: assert_equal 2, s.pos assert_equal nil, s.scan(/test/) + + # [ruby-bugs:4361] + s = StringScanner.new("") + assert_equal "", s.scan(//) + assert_equal "", s.scan(//) end def test_skip @@ -259,6 +264,11 @@ class TestStringScanner < Test::Unit::TestCase s.scan(/te/) s.string.replace '' assert_equal nil, s.skip(/./) + + # [ruby-bugs:4361] + s = StringScanner.new("") + assert_equal 0, s.skip(//) + assert_equal 0, s.skip(//) end def test_getch |
