Merge pull request #761 from mbj/fix/recursive-prefix-length
Fix prefix check for equivalent recursive namespaces
This commit is contained in:
commit
9e504b688e
2 changed files with 4 additions and 2 deletions
|
@ -44,7 +44,9 @@ module Mutant
|
|||
#
|
||||
# @return [Integer]
|
||||
def match_length(expression)
|
||||
if @recursion_pattern.match?(expression.syntax)
|
||||
if eql?(expression)
|
||||
syntax.length
|
||||
elsif @recursion_pattern.match?(expression.syntax)
|
||||
scope_name.length
|
||||
else
|
||||
0
|
||||
|
|
|
@ -22,7 +22,7 @@ RSpec.describe Mutant::Expression::Namespace::Recursive do
|
|||
context 'when other is an equivalent expression' do
|
||||
let(:other) { parse_expression(object.syntax) }
|
||||
|
||||
it { should be(0) }
|
||||
it { should be(object.syntax.length) }
|
||||
end
|
||||
|
||||
context 'when other expression describes a shorter prefix' do
|
||||
|
|
Loading…
Add table
Reference in a new issue