(t *testing.T)
| 5 | ) |
| 6 | |
| 7 | func 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 | |
| 20 | func TestGenerateDeviceAndUserCodeCollision(t *testing.T) { |
| 21 | deviceCodeSet := make(map[string]bool) |
nothing calls this directly
no test coverage detected