Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mwudka committed Dec 5, 2024
1 parent 6fcd0d8 commit 77f9553
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion v1/tasks/reflect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,15 @@ func TestReflectValue(t *testing.T) {
t.Errorf("type is %v, want %s", value.Type().String(), tc.expectedType)
}
if tc.expectedValue != nil {
if !reflect.DeepEqual(value.Interface(), tc.expectedValue) {
equal := false
if timeVal, ok := value.Interface().(time.Time); ok {
expectedTime := tc.expectedValue.(time.Time)
equal = timeVal.Equal(expectedTime)
} else {
equal = reflect.DeepEqual(value.Interface(), tc.expectedValue)
}

if !equal {
t.Errorf("value is %v, want %v", value.Interface(), tc.expectedValue)
}
}
Expand Down

0 comments on commit 77f9553

Please sign in to comment.