diff options
Diffstat (limited to 'spec/ruby/core/regexp')
-rw-r--r-- | spec/ruby/core/regexp/linear_time_spec.rb | 4 |
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 |