semver_common/mock/
mock_commit_map.rs1pub mod commit_map {
2 use crate::{CommitMap, mock};
3
4 pub fn create() -> CommitMap {
5 let mut commit_map = CommitMap::new();
6 let change_breaking_change =
7 mock::change::create("^(.|\n)*BREAKING_CHANGE(.|\n)*$", "BREAKING CHANGES", 1);
8 let change_feat = mock::change::create("^feat(.|\n)*$", "Feature", 2);
9 let change_fix = mock::change::create("^fix(.|\n)*$", "Fix", 3);
10 let commit_one = mock::commit::create("feat(scope): a test header");
11 let commit_two = mock::commit::create("feat(scope): a test header two");
12 let commit_three = mock::commit::create("fix(scope): a test header three");
13 let commit_four = mock::commit::create(
14 "fix(scope): a test header three\n\nBREAKING CHANGE: This is a breaking change.",
15 );
16 commit_map.insert(&change_feat, commit_one).unwrap();
17 commit_map.insert(&change_feat, commit_two).unwrap();
18 commit_map.insert(&change_fix, commit_three).unwrap();
19 commit_map
20 .insert(&change_breaking_change, commit_four)
21 .unwrap();
22 commit_map
23 }
24}