mirror of
https://github.com/martinvonz/jj.git
synced 2025-02-11 06:42:47 +00:00
revset: use ancestors(x, 0) in tree substitution test
This commit is contained in:
parent
8b825796ff
commit
dde1c1ec9c
1 changed files with 2 additions and 17 deletions
|
@ -4685,20 +4685,8 @@ mod tests {
|
||||||
"###);
|
"###);
|
||||||
|
|
||||||
// Ancestors of empty generation range should be empty.
|
// Ancestors of empty generation range should be empty.
|
||||||
// TODO: rewrite these tests if we added syntax for arbitrary generation
|
|
||||||
// ancestors
|
|
||||||
let empty_generation_ancestors = |heads| {
|
|
||||||
Rc::new(RevsetExpression::Ancestors {
|
|
||||||
heads,
|
|
||||||
generation: GENERATION_RANGE_EMPTY,
|
|
||||||
is_legacy: false,
|
|
||||||
})
|
|
||||||
};
|
|
||||||
insta::assert_debug_snapshot!(
|
insta::assert_debug_snapshot!(
|
||||||
optimize(empty_generation_ancestors(
|
optimize(parse("ancestors(ancestors(foo), 0)").unwrap()), @r###"
|
||||||
RevsetExpression::symbol("foo".to_owned()).ancestors()
|
|
||||||
)),
|
|
||||||
@r###"
|
|
||||||
Ancestors {
|
Ancestors {
|
||||||
heads: CommitRef(
|
heads: CommitRef(
|
||||||
Symbol(
|
Symbol(
|
||||||
|
@ -4711,10 +4699,7 @@ mod tests {
|
||||||
"###
|
"###
|
||||||
);
|
);
|
||||||
insta::assert_debug_snapshot!(
|
insta::assert_debug_snapshot!(
|
||||||
optimize(
|
optimize(parse("ancestors(ancestors(foo, 0))").unwrap()), @r###"
|
||||||
empty_generation_ancestors(RevsetExpression::symbol("foo".to_owned())).ancestors()
|
|
||||||
),
|
|
||||||
@r###"
|
|
||||||
Ancestors {
|
Ancestors {
|
||||||
heads: CommitRef(
|
heads: CommitRef(
|
||||||
Symbol(
|
Symbol(
|
||||||
|
|
Loading…
Reference in a new issue