mirror of
https://github.com/Slug-Boi/cocommit.git
synced 2026-05-13 12:45:47 +00:00
Merge branch 'main' into cobra_commands
This commit is contained in:
@@ -65,7 +65,7 @@ func Test_add_all(t *testing.T) {
|
||||
if !strings.Contains(commit, "\nCo-authored-by: test1 <test1>") ||
|
||||
!strings.Contains(commit, "\nCo-authored-by: test2 <test2>") ||
|
||||
!strings.Contains(commit, "\nCo-authored-by: test3 <test3>") {
|
||||
t.Fatalf("String built incorrectly. Strings did not match: Created -> %s Expected -> Co-authored-by: test <test>",commit)
|
||||
t.Fatalf("String built incorrectly. Strings did not match: Created -> %s Expected -> Co-authored-by: test1 <test1>\nCo-authored-by: test2 <test2>\n\nCo-authored-by: test3 <test3>",commit)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,10 +79,48 @@ func Test_exclude_user(t *testing.T) {
|
||||
|
||||
commit := sb_build()
|
||||
if strings.Contains(commit, "\nCo-authored-by: test1 <test1>") {
|
||||
t.Fatalf("String built incorrectly. Strings did not match: Created -> %s Expected -> Co-authored-by: test <test>",commit)
|
||||
t.Fatalf("String built incorrectly. Strings did not match: Created -> %s Expected -> Co-authored-by: test2 <test2>\n\nCo-authored-by: test3 <test3>",commit)
|
||||
}
|
||||
}
|
||||
|
||||
func Test_exclude_by_default(t *testing.T) {
|
||||
// Reusing users from before
|
||||
defExclude = append(defExclude, users["test1"].username)
|
||||
|
||||
sb.Reset()
|
||||
|
||||
add_x_users([]string{})
|
||||
|
||||
commit := sb_build()
|
||||
|
||||
if strings.Contains(commit, "\nCo-authored-by: test1 <test1>") {
|
||||
t.Fatalf("String built incorrectly. Strings did not match: Created -> %s Expected -> Co-authored-by: test2 <test2>\n\nCo-authored-by: test3 <test3>",commit)
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user