Browse Source

Fix tests.

Dmitry Chestnykh 14 years ago
parent
commit
a85bba1018
2 changed files with 5 additions and 5 deletions
  1. 4 4
      captcha_test.go
  2. 1 1
      store_test.go

+ 4 - 4
captcha_test.go

@@ -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

+ 1 - 1
store_test.go

@@ -43,7 +43,7 @@ func TestCollect(t *testing.T) {
 		ids[i] = uniuri.New()
 		s.Set(ids[i], d)
 	}
-	s.Collect()
+	s.(*memoryStore).collect()
 	// Must be already collected
 	nc := 0
 	for i := range ids {