test: added a test for grouping

This commit is contained in:
Theis
2024-03-06 12:47:26 +01:00
parent aa81eb0e73
commit 27a755ce81
2 changed files with 33 additions and 9 deletions
+23
View File
@@ -98,6 +98,29 @@ func Test_exclude_by_default(t *testing.T) {
}
}
func Test_commit_with_grouping(t *testing.T) {
for k := range groups {
delete(groups, k)
}
defExclude = []string{}
groups["test1"] = []user{users["test1"]}
excludeMode := group_selection(groups["test1"], []string{})
sb.Reset()
add_x_users(excludeMode)
commit := sb_build()
if commit != "\nCo-authored-by: test1 <test1>" {
t.Fatalf("String built incorrectly. Strings did not match: Created -> %s Expected -> Co-authored-by: test <test>",commit)
}
}