mirror of
https://github.com/ruby/ruby.git
synced 2025-08-28 15:36:16 +02:00
string.c: fix scanned substring with \K
* string.c (scan_once): fix the matched substring with `\K`, the beginning of that string may differ from the matched position. [ruby-core:86663] [Bug #14707] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3471d0f6d6
commit
2c8f16e6c0
2 changed files with 3 additions and 0 deletions
|
@ -1542,6 +1542,8 @@ CODE
|
|||
assert_nil($~)
|
||||
|
||||
assert_equal(3, S("hello hello hello").scan("hello".taint).count(&:tainted?))
|
||||
|
||||
assert_equal(%w[1 2 3], S("a1 a2 a3").scan(/a\K./))
|
||||
end
|
||||
|
||||
def test_size
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue