duplicates test

This commit is contained in:
alessio 2017-08-15 01:45:30 +02:00
parent 81c630ba31
commit a06563d4c9
1 changed files with 21 additions and 0 deletions

View File

@ -16,3 +16,24 @@ func TestArgsParam(t *testing.T) {
t.Fatal("Expected 2 instead", len(result))
}
}
func TestDuplicates(t *testing.T) {
projects := []Project{
{
Name: "a",
}, {
Name: "b",
}, {
Name: "c",
},
}
_, err := duplicates(projects[0], projects)
if err == nil {
t.Fatal("Error unexpected", err)
}
_, err = duplicates(Project{}, projects)
if err != nil {
t.Fatal("Error unexpected", err)
}
}