Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7ed901b

Browse files
committed
equate empty for nil/zero slice
1 parent 521aed8 commit 7ed901b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

coderd/database/dbauthz/setup_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"testing"
1111

1212
"github.com/google/go-cmp/cmp"
13+
"github.com/google/go-cmp/cmp/cmpopts"
1314
"github.com/google/uuid"
1415
"github.com/open-policy-agent/opa/topdown"
1516
"github.com/stretchr/testify/require"
@@ -200,7 +201,7 @@ func (s *MethodTestSuite) Subtest(testCaseF func(db database.Store, check *expec
200201
for i := range outputs {
201202
a, b := testCase.outputs[i].Interface(), outputs[i].Interface()
202203
// Use cmp.Diff to get a nice diff of the two values.
203-
if diff := cmp.Diff(a, b); diff != "" {
204+
if diff := cmp.Diff(a, b, cmpopts.EquateEmpty()); diff != "" {
204205
s.Failf("compare outputs failed", "method %q returned unexpected output %d (-want +got):\n%s", methodName, i, diff)
205206
}
206207
}

0 commit comments

Comments
 (0)