Skip to content

Commit 7a802a9

Browse files
committed
Remove testable example
1 parent 0df7f28 commit 7a802a9

File tree

1 file changed

+8
-24
lines changed

1 file changed

+8
-24
lines changed

coderd/coderdtest/uuids_test.go

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,17 @@
11
package coderdtest_test
22

33
import (
4-
"github.com/google/uuid"
4+
"testing"
5+
6+
"github.com/stretchr/testify/require"
57

68
"github.com/coder/coder/v2/coderd/coderdtest"
79
)
810

9-
func ExampleNewDeterministicUUIDGenerator() {
10-
det := coderdtest.NewDeterministicUUIDGenerator()
11-
testCases := []struct {
12-
CreateUsers []uuid.UUID
13-
ExpectedIDs []uuid.UUID
14-
}{
15-
{
16-
CreateUsers: []uuid.UUID{
17-
det.ID("player1"),
18-
det.ID("player2"),
19-
},
20-
ExpectedIDs: []uuid.UUID{
21-
det.ID("player1"),
22-
det.ID("player2"),
23-
},
24-
},
25-
}
11+
func TestDeterministicUUIDGenerator(t *testing.T) {
12+
t.Parallel()
2613

27-
for _, tc := range testCases {
28-
tc := tc
29-
_ = tc
30-
// Do the test with CreateUsers as the setup, and the expected IDs
31-
// will match.
32-
}
14+
ids := coderdtest.NewDeterministicUUIDGenerator()
15+
require.Equal(t, ids.ID("g1"), ids.ID("g1"))
16+
require.NotEqual(t, ids.ID("g1"), ids.ID("g2"))
3317
}

0 commit comments

Comments
 (0)