mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 21:49:06 +02:00
[ruby/strscan] Add test case to test_string
(https://github.com/ruby/strscan/pull/58) `string` returns the original string after `scan` is called. Current test doesn't check this behavior and now it's covered.
This commit is contained in:
parent
18e840ac60
commit
260bc7cdfa
1 changed files with 4 additions and 2 deletions
|
@ -155,8 +155,10 @@ class TestStringScanner < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_string
|
def test_string
|
||||||
s = create_string_scanner('test')
|
s = create_string_scanner('test string')
|
||||||
assert_equal 'test', s.string
|
assert_equal 'test string', s.string
|
||||||
|
s.scan(/test/)
|
||||||
|
assert_equal 'test string', s.string
|
||||||
s.string = 'a'
|
s.string = 'a'
|
||||||
assert_equal 'a', s.string
|
assert_equal 'a', s.string
|
||||||
s.scan(/a/)
|
s.scan(/a/)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue