(t *testing.T)
| 131 | } |
| 132 | |
| 133 | func TestGenerateCodeVerifierString(t *testing.T) { |
| 134 | randomString, err := GenerateCodeVerifierString(96) |
| 135 | assert.NoError(t, err) |
| 136 | |
| 137 | // Should be 128 characters long |
| 138 | assert.Equal(t, 128, len([]byte(randomString))) |
| 139 | |
| 140 | // All non-ascii characters removed should still be the original string |
| 141 | removedChars := strings.Map(func(r rune) rune { |
| 142 | if r > unicode.MaxASCII { |
| 143 | return -1 |
| 144 | } |
| 145 | return r |
| 146 | }, randomString) |
| 147 | assert.Equal(t, removedChars, randomString) |
| 148 | } |
nothing calls this directly
no test coverage detected