From e0c5488ff9308b1a16718c64bc9096caca88ed83 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Fri, 28 Jan 2022 14:42:38 +0100 Subject: Update to ruby/spec@902ab83 --- spec/ruby/core/string/split_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'spec/ruby/core/string/split_spec.rb') diff --git a/spec/ruby/core/string/split_spec.rb b/spec/ruby/core/string/split_spec.rb index 94f6c9aaee..2e03955a26 100644 --- a/spec/ruby/core/string/split_spec.rb +++ b/spec/ruby/core/string/split_spec.rb @@ -224,6 +224,17 @@ describe "String#split with String" do end end end + + it "returns an empty array when whitespace is split on whitespace" do + " ".split(" ").should == [] + " \n ".split(" ").should == [] + " ".split(" ").should == [] + " \t ".split(" ").should == [] + end + + it "doesn't split on non-ascii whitespace" do + "a\u{2008}b".split(" ").should == ["a\u{2008}b"] + end end describe "String#split with Regexp" do -- cgit v1.2.3