summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/shared
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-27 13:12:39 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-27 13:12:39 +0000
commit42921458ff7eacd1ef614c3e67596c75ccd0a1d4 (patch)
tree710c40988e51715f84a12c3295162b1c5697bf51 /spec/ruby/core/string/shared
parenta53ee2136ff59ebc54ae6c98a500765bc3d13d44 (diff)
Update to ruby/spec@e57f49c
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/core/string/shared')
-rw-r--r--spec/ruby/core/string/shared/each_line.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/ruby/core/string/shared/each_line.rb b/spec/ruby/core/string/shared/each_line.rb
index 19cf5e6d78..066b0c1040 100644
--- a/spec/ruby/core/string/shared/each_line.rb
+++ b/spec/ruby/core/string/shared/each_line.rb
@@ -27,6 +27,19 @@ describe :string_each_line, shared: true do
c.should == ["hello\n", "\n", "\n", "world"]
end
+ it "splits strings containing multibyte characters" do
+ s = <<~EOS
+ foo
+ 🤡🤡🤡🤡🤡🤡🤡
+ bar
+ baz
+ EOS
+
+ b = []
+ s.send(@method) { |part| b << part }
+ b.should == ["foo\n", "🤡🤡🤡🤡🤡🤡🤡\n", "bar\n", "baz\n"]
+ end
+
it "taints substrings that are passed to the block if self is tainted" do
"one\ntwo\r\nthree".taint.send(@method) { |s| s.tainted?.should == true }