Skip to content

Commit 91a6d37

Browse files
committed
testutils#TestCase: Allow T any instead of T comparable
We use `require.Equal()` for comparison anyway so the type can be relaxed. This is particularly useful for testing types like `logging#Config`, which contains a map and thus would not satisfy comparable.
1 parent 3b9c90b commit 91a6d37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

testutils/testutils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
// TestCase represents a generic test case structure.
1616
// It is parameterized by T, the type of the expected result, and D, the type of the test data.
1717
// This struct is useful for defining test cases with expected outcomes and associated data.
18-
type TestCase[T comparable, D any] struct {
18+
type TestCase[T any, D any] struct {
1919
// Name is the identifier for the test case, used for reporting purposes.
2020
Name string
2121
// Expected is the anticipated result of the test. It should be left empty if an error is expected.

0 commit comments

Comments
 (0)