Merge pull request #26 from silasb/catch-all-continues-to-check-for-key-chars-when-path-chars-differ
Catch all will continue checking key chars when path chars differ
This commit is contained in:
commit
461509d7c1
|
@ -451,6 +451,14 @@ module Radix
|
|||
result.found?.should be_false
|
||||
end
|
||||
|
||||
it "does not find when path search has been exhausted" do
|
||||
tree = Tree(Symbol).new
|
||||
tree.add "/members/*trailing", :members_catch_all
|
||||
|
||||
result = tree.find("/members2")
|
||||
result.found?.should be_false
|
||||
end
|
||||
|
||||
it "does prefer specific path over catch all if both are present" do
|
||||
tree = Tree(Symbol).new
|
||||
tree.add "/members", :members
|
||||
|
|
|
@ -324,6 +324,9 @@ module Radix
|
|||
return
|
||||
end
|
||||
end
|
||||
|
||||
# path differs from key, no use searching anymore
|
||||
return
|
||||
end
|
||||
|
||||
# key still contains characters to walk
|
||||
|
|
Loading…
Reference in New Issue