fix(test): cast result before comparing

This commit is contained in:
kolaente 2024-04-21 19:43:57 +02:00
parent 574c7f218e
commit ea7527a3cf
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B
1 changed files with 5 additions and 2 deletions

View File

@ -62,7 +62,7 @@ func TestLabel_ReadAll(t *testing.T) {
name string
fields fields
args args
wantLs interface{}
wantLs []*LabelWithTaskID
wantErr bool
}{
{
@ -143,7 +143,10 @@ func TestLabel_ReadAll(t *testing.T) {
t.Errorf("Label.ReadAll() error = %v, wantErr %v", err, tt.wantErr)
return
}
if diff, equal := messagediff.PrettyDiff(gotLs, tt.wantLs); !equal {
got := gotLs.([]*LabelWithTaskID)
if diff, equal := messagediff.PrettyDiff(got, tt.wantLs); !equal {
t.Errorf("Label.ReadAll() = %v, want %v, diff: %v", gotLs, tt.wantLs, diff)
}
s.Close()