MCPcopy Index your code
hub / github.com/rilldata/rill / TestGenerateDeviceAndUserCode

Function TestGenerateDeviceAndUserCode

admin/auth_code_test.go:7–18  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

5)
6
7func TestGenerateDeviceAndUserCode(t *testing.T) {
8 authCode, err := generateDeviceAndUserCode()
9 if err != nil {
10 t.Error(err)
11 }
12 if len(authCode.DeviceCode) != 32 {
13 t.Errorf("device code length is incorrect; got %d, want 32", len(authCode.DeviceCode))
14 }
15 if len(authCode.UserCode) != 8 {
16 t.Errorf("user code length is incorrect; got %d, want 8", len(authCode.UserCode))
17 }
18}
19
20func TestGenerateDeviceAndUserCodeCollision(t *testing.T) {
21 deviceCodeSet := make(map[string]bool)

Callers

nothing calls this directly

Calls 3

ErrorfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected