diff options
author | Benoit Daloze <eregontp@gmail.com> | 2022-01-28 14:42:38 +0100 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2022-01-28 14:42:38 +0100 |
commit | e0c5488ff9308b1a16718c64bc9096caca88ed83 (patch) | |
tree | b0ede98f96c4477c470bef45547abff525215b21 /spec/ruby/core/string | |
parent | bb5f71088774b14c96fe11718e5e1b7ffb20fff2 (diff) | |
download | ruby-e0c5488ff9308b1a16718c64bc9096caca88ed83.tar.gz |
Update to ruby/spec@902ab83
Diffstat (limited to 'spec/ruby/core/string')
-rw-r--r-- | spec/ruby/core/string/split_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
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 |