Skip to content

Commit f8c065e

Browse files
eregonandrykonchin
authored andcommitted
Add spec for Regexp.linear_time? + binary Regexp
1 parent ce80497 commit f8c065e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/regexp/linear_time_spec.rb

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

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

0 commit comments

Comments
 (0)