Skip to content

Commit

Permalink
test(repo): expand unit tests of the repo module (#909)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsquire authored Oct 9, 2024
1 parent e936ed5 commit da1cb61
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion git-cliff-core/src/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,11 +512,24 @@ mod test {
Ok(())
}

#[test]
fn commit_search() -> Result<()> {
let repository = get_repository()?;
assert!(repository
.find_commit("e936ed571533ea6c41a1dd2b1a29d085c8dbada5")
.is_some());
Ok(())
}

#[test]
fn get_latest_tag() -> Result<()> {
let repository = get_repository()?;
let tags = repository.tags(&None, false, false)?;
assert_eq!(get_last_tag()?, tags.last().expect("no tags found").1.name);
let latest = tags.last().expect("no tags found").1.name.clone();
assert_eq!(get_last_tag()?, latest);

let current = repository.current_tag().expect("a current tag").name;
assert!(current.contains(&latest));
Ok(())
}

Expand Down

0 comments on commit da1cb61

Please sign in to comment.