diff options
author | Benoit Daloze <eregontp@gmail.com> | 2022-07-27 17:18:25 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2022-07-27 17:18:25 +0200 |
commit | 6582df26dcdef5dab01242b4d97d9b242e959860 (patch) | |
tree | 99824a5c370ef27acd12905b67304870f1af9561 /spec/ruby/core/string/start_with_spec.rb | |
parent | 44f42413e6c3c2b487a03b53bf6cacbb83ac285b (diff) | |
download | ruby-6582df26dcdef5dab01242b4d97d9b242e959860.tar.gz |
Update to ruby/spec@cbfaf51
Diffstat (limited to 'spec/ruby/core/string/start_with_spec.rb')
-rw-r--r-- | spec/ruby/core/string/start_with_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/ruby/core/string/start_with_spec.rb b/spec/ruby/core/string/start_with_spec.rb index aaed197ff3..3833289f96 100644 --- a/spec/ruby/core/string/start_with_spec.rb +++ b/spec/ruby/core/string/start_with_spec.rb @@ -5,4 +5,14 @@ require_relative '../../shared/string/start_with' describe "String#start_with?" do it_behaves_like :start_with, :to_s + + # Here and not in the shared examples because this is invalid as a Symbol + it "does not check that we are not starting to match at the head of a character" do + "\xA9".should.start_with?("\xA9") # A9 is not a character head for UTF-8 + end + + it "does not check we are matching only part of a character" do + "\xe3\x81\x82".size.should == 1 + "\xe3\x81\x82".should.start_with?("\xe3") + end end |