Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
BatmanAoD committed Jun 13, 2024
1 parent 6698966 commit 7904bb5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/tests/test_revset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1816,6 +1816,24 @@ fn test_evaluate_expression_descendants() {
commit3.id().clone(),
]
);

// Can find next n descendants of a commit
assert_eq!(
resolve_commit_ids(mut_repo, &format!("descendants({}, 0)", commit2.id().hex())),
vec![]
);
assert_eq!(
resolve_commit_ids(mut_repo, &format!("descendants({}, 1)", commit3.id().hex())),
vec![commit3.id().clone()]
);
assert_eq!(
resolve_commit_ids(mut_repo, &format!("descendants({}, 3)", commit3.id().hex())),
vec![
commit3.id().clone(),
commit4.id().clone(),
commit5.id().clone(),
]
);
}

#[test]
Expand Down

0 comments on commit 7904bb5

Please sign in to comment.