forked from kemitix/git-next
34 lines
1.1 KiB
Rust
34 lines
1.1 KiB
Rust
//
|
|
use super::*;
|
|
mod branch {
|
|
use super::super::branch::*;
|
|
use super::*;
|
|
|
|
#[actix_rt::test]
|
|
async fn test_find_next_commit_on_dev() {
|
|
let next = git::Commit::new(
|
|
git::commit::Sha::new("current-next".to_string()),
|
|
git::commit::Message::new("foo".to_string()),
|
|
);
|
|
let expected = git::Commit::new(
|
|
git::commit::Sha::new("dev-next".to_string()),
|
|
git::commit::Message::new("next-should-go-here".to_string()),
|
|
);
|
|
let dev_commit_history = vec![
|
|
git::Commit::new(
|
|
git::commit::Sha::new("dev".to_string()),
|
|
git::commit::Message::new("future".to_string()),
|
|
),
|
|
expected.clone(),
|
|
next.clone(),
|
|
git::Commit::new(
|
|
git::commit::Sha::new("current-main".to_string()),
|
|
git::commit::Message::new("history".to_string()),
|
|
),
|
|
];
|
|
|
|
let next_commit = find_next_commit_on_dev(next, dev_commit_history);
|
|
|
|
assert_eq!(next_commit, Some(expected), "Found the wrong commit");
|
|
}
|
|
}
|