forked from mirrors/jj
revset: add test of filter intersection over non-linear tree
Previously we only have a test for the left recursion. The added test contains right recursion path, which should have caught the error I made while working on the next "unary filter node" patch.
This commit is contained in:
parent
48d426529c
commit
6d977c73e4
1 changed files with 37 additions and 0 deletions
|
@ -2764,6 +2764,43 @@ mod tests {
|
|||
),
|
||||
}
|
||||
"###);
|
||||
insta::assert_debug_snapshot!(
|
||||
optimize(parse("(a & author(A)) & ((b & author(B)) & (c & author(C))) & d").unwrap()),
|
||||
@r###"
|
||||
Filter {
|
||||
candidates: Filter {
|
||||
candidates: Filter {
|
||||
candidates: Intersection(
|
||||
Intersection(
|
||||
Symbol(
|
||||
"a",
|
||||
),
|
||||
Intersection(
|
||||
Symbol(
|
||||
"b",
|
||||
),
|
||||
Symbol(
|
||||
"c",
|
||||
),
|
||||
),
|
||||
),
|
||||
Symbol(
|
||||
"d",
|
||||
),
|
||||
),
|
||||
predicate: Author(
|
||||
"A",
|
||||
),
|
||||
},
|
||||
predicate: Author(
|
||||
"B",
|
||||
),
|
||||
},
|
||||
predicate: Author(
|
||||
"C",
|
||||
),
|
||||
}
|
||||
"###);
|
||||
|
||||
// 'all()' moves in to 'filter()' first, so 'A & filter()' can be found.
|
||||
insta::assert_debug_snapshot!(
|
||||
|
|
Loading…
Reference in a new issue