csrf/token_test.go
2025-06-11 00:24:24 +05:00

19 lines
330 B
Go

package csrf
import (
"testing"
)
func TestTokenGeneration(t *testing.T) {
var tokenLength uint = 8
token, err := generateCSRFToken(tokenLength)
if err != nil {
t.Error(err)
}
actualTokenLength := uint(len(token))
if actualTokenLength != tokenLength {
t.Errorf("incorrect token length: %d", actualTokenLength)
}
}