mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test String#each_line when separator is longer than string.
Thanks Charles Nutter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
28827e61d1
commit
ac37fc37b1
1 changed files with 7 additions and 0 deletions
|
@ -647,6 +647,13 @@ class TestString < Test::Unit::TestCase
|
|||
assert_equal(S("hello!"), res[0])
|
||||
assert_equal(S("world"), res[1])
|
||||
|
||||
$/ = "ab"
|
||||
|
||||
res=[]
|
||||
S("a").lines.each {|x| res << x}
|
||||
assert_equal(1, res.size)
|
||||
assert_equal(S("a"), res[0])
|
||||
|
||||
$/ = save
|
||||
|
||||
s = nil
|
||||
|
|
Loading…
Add table
Reference in a new issue