TestStringSlice_Set: check error even if none is returned

This commit is contained in:
Adrien Delorme 2020-03-12 18:01:20 +01:00
parent 710ebdcef5
commit 7ec39ebb4e
1 changed files with 4 additions and 1 deletions

View File

@ -22,7 +22,10 @@ func TestStringSlice_Set(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
for _, value := range tt.args.values {
tt.s.Set(value)
err := tt.s.Set(value)
if err != nil {
t.Fatal(err)
}
}
if diff := cmp.Diff(tt.s, tt.wantStringSlice); diff != "" {
t.Fatal(diff)