mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
[ruby/strscan] Don't add begin to length for new string slice
(https://github.com/ruby/strscan/pull/87) Fixes https://github.com/ruby/strscan/pull/86 https://github.com/ruby/strscan/commit/c17b015c00
This commit is contained in:
parent
5afae77ce9
commit
39f2e37ff1
@ -841,4 +841,12 @@ class TestStringScannerFixedAnchor < Test::Unit::TestCase
|
||||
assert_equal 1, s.skip(/a/)
|
||||
assert_nil s.skip(/^b/)
|
||||
end
|
||||
|
||||
# ruby/strscan#86
|
||||
def test_scan_shared_string
|
||||
s = "hellohello"[5..-1]
|
||||
ss = StringScanner.new(s).scan(/hello/)
|
||||
|
||||
assert_equal "hello", ss
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user