Skip to content

Commit 21550be

Browse files
committed
Add spec for Regexp.linear_time? + binary Regexp
1 parent 2a22e2f commit 21550be

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spec/ruby/core/regexp/linear_time_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
Regexp.linear_time?('a').should == true
88
end
99

10+
it "returns true if matching can be done in linear time for a binary Regexp" do
11+
Regexp.linear_time?(/[\x80-\xff]/n).should == true
12+
end
13+
1014
it "return false if matching can't be done in linear time" do
1115
Regexp.linear_time?(/(a)\1/).should == false
1216
Regexp.linear_time?("(a)\\1").should == false

0 commit comments

Comments
 (0)