|
|
@@ -6,18 +6,18 @@ import (
|
|
|
)
|
|
|
|
|
|
func TestNew(t *testing.T) {
|
|
|
- c := New(StdLength)
|
|
|
+ c := New()
|
|
|
if c == "" {
|
|
|
t.Errorf("expected id, got empty string")
|
|
|
}
|
|
|
}
|
|
|
|
|
|
func TestVerify(t *testing.T) {
|
|
|
- id := New(StdLength)
|
|
|
+ id := New()
|
|
|
if Verify(id, []byte{0, 0}) {
|
|
|
t.Errorf("verified wrong captcha")
|
|
|
}
|
|
|
- id = New(StdLength)
|
|
|
+ id = New()
|
|
|
d := globalStore.Get(id, false) // cheating
|
|
|
if !Verify(id, d) {
|
|
|
t.Errorf("proper captcha not verified")
|
|
|
@@ -25,7 +25,7 @@ func TestVerify(t *testing.T) {
|
|
|
}
|
|
|
|
|
|
func TestReload(t *testing.T) {
|
|
|
- id := New(StdLength)
|
|
|
+ id := New()
|
|
|
d1 := globalStore.Get(id, false) // cheating
|
|
|
Reload(id)
|
|
|
d2 := globalStore.Get(id, false) // cheating again
|