File tree Expand file tree Collapse file tree 1 file changed +8
-24
lines changed Expand file tree Collapse file tree 1 file changed +8
-24
lines changed Original file line number Diff line number Diff line change 1
1
package coderdtest_test
2
2
3
3
import (
4
- "github.com/google/uuid"
4
+ "testing"
5
+
6
+ "github.com/stretchr/testify/require"
5
7
6
8
"github.com/coder/coder/v2/coderd/coderdtest"
7
9
)
8
10
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 ()
26
13
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" ))
33
17
}
You can’t perform that action at this time.
0 commit comments