diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-25 23:50:09 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-25 23:50:09 +0000 |
commit | da1a1f0b6ed0b0c4284684452da4f6f290be8057 (patch) | |
tree | ce70c76d604fab1f10b157802cd0bd70ffe13508 /test/ruby | |
parent | c5850485042cf0e591e940c2687e6af719502e88 (diff) | |
download | ruby-da1a1f0b6ed0b0c4284684452da4f6f290be8057.tar.gz |
string.c: consistent paragraph mode with IO
* string.c (rb_str_enumerate_lines): in paragraph mode, do not
include newlines which separate paragraphs, so that it will be
consistent with IO#each_line.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_string.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 4dee245462..d1da27bdb3 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -661,8 +661,8 @@ CODE res=[] S("hello\n\n\nworld").lines(S('')).each {|x| res << x} - assert_equal(S("hello\n\n\n"), res[0]) - assert_equal(S("world"), res[1]) + assert_equal(S("hello\n\n"), res[0]) + assert_equal(S("world"), res[1]) $/ = "!" res=[] @@ -782,8 +782,8 @@ CODE res=[] S("hello\n\n\nworld").each_line(S('')) {|x| res << x} - assert_equal(S("hello\n\n\n"), res[0]) - assert_equal(S("world"), res[1]) + assert_equal(S("hello\n\n"), res[0]) + assert_equal(S("world"), res[1]) $/ = "!" @@ -824,8 +824,8 @@ CODE res = [] S("hello\n\n\nworld").each_line(S(''), chomp: true) {|x| res << x} - assert_equal(S("hello\n\n"), res[0]) - assert_equal(S("world"), res[1]) + assert_equal(S("hello\n"), res[0]) + assert_equal(S("world"), res[1]) res = [] S("hello!world").each_line(S('!'), chomp: true) {|x| res << x} |