git-next/crates/repo-actor/src/tests.rs
Paul Campbell 46b6d8680c
All checks were successful
Rust / build (push) Successful in 1m47s
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/push-next Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful
feat: Add support for GitHub
This doesn't include GitHub Enterprise

Closes kemitix/git-next#86
2024-05-31 07:23:48 +01:00

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");
}
}