summaryrefslogtreecommitdiff
path: root/spec/ruby/core/regexp
diff options
context:
space:
mode:
authorAndrew Konchin <[email protected]>2025-06-02 19:34:54 +0300
committerBenoit Daloze <[email protected]>2025-06-02 21:54:48 +0200
commitd6aa1714fed3e8b5ee8bede00a8853c338ff6092 (patch)
treeea863a44d9026f74b9a07375f401c3e5d8cb4bf5 /spec/ruby/core/regexp
parent685c8ca9af892f562f64b54dbee73bb9a1999b90 (diff)
Update to ruby/spec@4d2fc4d
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13495
Diffstat (limited to 'spec/ruby/core/regexp')
-rw-r--r--spec/ruby/core/regexp/linear_time_spec.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/ruby/core/regexp/linear_time_spec.rb b/spec/ruby/core/regexp/linear_time_spec.rb
index a6f8dccd46..c3b3500549 100644
--- a/spec/ruby/core/regexp/linear_time_spec.rb
+++ b/spec/ruby/core/regexp/linear_time_spec.rb
@@ -6,6 +6,10 @@ describe "Regexp.linear_time?" do
Regexp.linear_time?('a').should == true
end
+ it "returns true if matching can be done in linear time for a binary Regexp" do
+ Regexp.linear_time?(/[\x80-\xff]/n).should == true
+ end
+
it "return false if matching can't be done in linear time" do
Regexp.linear_time?(/(a)\1/).should == false
Regexp.linear_time?("(a)\\1").should == false