mirror of
https://github.com/martinvonz/jj.git
synced 2025-05-22 23:51:12 +00:00
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
@ -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.
|
// 'all()' moves in to 'filter()' first, so 'A & filter()' can be found.
|
||||||
insta::assert_debug_snapshot!(
|
insta::assert_debug_snapshot!(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user