From dde1c1ec9ce62ffec68a357bebb736571ae0f461 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Fri, 8 Sep 2023 08:43:46 +0900 Subject: [PATCH] revset: use ancestors(x, 0) in tree substitution test --- lib/src/revset.rs | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/lib/src/revset.rs b/lib/src/revset.rs index aa899d52bc..3f72f57c1c 100644 --- a/lib/src/revset.rs +++ b/lib/src/revset.rs @@ -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( @@ -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(