mirror of
https://github.com/Slug-Boi/cocommit.git
synced 2026-05-13 12:45:47 +00:00
added a few tests to the new functionality
This commit is contained in:
@@ -37,6 +37,36 @@ func Test_usersInput(t *testing.T) {
|
||||
}
|
||||
t.Fatalf("process ran with err %v, want exit status 1", err)
|
||||
}
|
||||
//TODO: Turn this into a fuzz test
|
||||
|
||||
func Test_commit_message(t *testing.T) {
|
||||
//authors := make(map[string]user)
|
||||
users["test"] = user{username: "test", email: "test"}
|
||||
sb_author("test")
|
||||
commit := sb_build()
|
||||
if commit != "\nCo-authored-by: test <test>" {
|
||||
t.Fatalf("String built incorrectly. Strings did not match: Created -> %s Expected -> Co-authored-by: test <test>",commit)
|
||||
}
|
||||
}
|
||||
//TODO: Turn this into a fuzz test
|
||||
func Test_add_all(t *testing.T) {
|
||||
for k := range users {
|
||||
delete(users, k)
|
||||
}
|
||||
users["test1"] = user{username: "test1", email: "test1"}
|
||||
users["test2"] = user{username: "test2", email: "test2"}
|
||||
users["test3"] = user{username: "test3", email: "test3"}
|
||||
all_flag = true
|
||||
add_x_users([]string{})
|
||||
|
||||
commit := sb_build()
|
||||
|
||||
if commit != "\nCo-authored-by: test <test>\nCo-authored-by: test1 <test1>\nCo-authored-by: test2 <test2>\nCo-authored-by: test3 <test3>" {
|
||||
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