Skip to content

Commit

Permalink
fix bug in includes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Avital committed Jan 22, 2024
1 parent 1d109ad commit a499d56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion commons/zenoh-keyexpr/src/key_expr/include.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl Includer<&[u8], &[u8]> for LTRIncluder {
let (lchunk, lrest) = left.split_once(&DELIMITER);
let lempty = lrest.is_empty();
if lchunk == DOUBLE_WILD {
if (lempty && !right.has_verbatim()) || self.includes(lrest, right) {
if (lempty && !right.has_verbatim()) || (!lempty && self.includes(lrest, right)) {
return true;
}
if unsafe { right.has_direct_verbatim_non_empty() } {
Expand Down
4 changes: 4 additions & 0 deletions commons/zenoh-keyexpr/src/key_expr/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ fn intersections() {
assert!(!intersect("@a/**", "@a/@b"));
assert!(intersect("@a/**/@b", "@a/@b"));
assert!(intersect("@a/@b/**", "@a/@b"));
assert!(intersect("@a/**/@c/**/@b", "@a/**/@c/@b"));
assert!(intersect("@a/**/@c/**/@b", "@a/@c/**/@b"));
assert!(intersect("@a/**/@c/@b", "@a/@c/**/@b"));
assert!(!intersect("@a/**/@b", "@a/**/@c/**/@b"));
}

fn includes<
Expand Down

0 comments on commit a499d56

Please sign in to comment.