Initial commit
This commit is contained in:
commit
f2788efb82
9 changed files with 954 additions and 0 deletions
19
token_test.go
Normal file
19
token_test.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
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)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue