Skip to content

Commit

Permalink
revset: use ancestors(x, 0) in tree substitution test
Browse files Browse the repository at this point in the history
  • Loading branch information
yuja committed Sep 8, 2023
1 parent 1e46114 commit c98526d
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions lib/src/revset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4685,20 +4685,8 @@ mod tests {
"###);

// 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!(
optimize(empty_generation_ancestors(
RevsetExpression::symbol("foo".to_owned()).ancestors()
)),
@r###"
optimize(parse("ancestors(ancestors(foo), 0)").unwrap()), @r###"
Ancestors {
heads: CommitRef(
Symbol(
Expand All @@ -4711,10 +4699,7 @@ mod tests {
"###
);
insta::assert_debug_snapshot!(
optimize(
empty_generation_ancestors(RevsetExpression::symbol("foo".to_owned())).ancestors()
),
@r###"
optimize(parse("ancestors(ancestors(foo, 0))").unwrap()), @r###"
Ancestors {
heads: CommitRef(
Symbol(
Expand Down

0 comments on commit c98526d

Please sign in to comment.