all repos — captcha @ a85bba10185c8b4c163e706d433db483d3b003c2

Go package captcha implements generation and verification of image and audio CAPTCHAs.

Fix tests.
Dmitry Chestnykh dmitry@codingrobots.com
Thu, 28 Apr 2011 00:02:57 +0200
commit

a85bba10185c8b4c163e706d433db483d3b003c2

parent

5192a0664066c8eec853787f8036415a4ae8ebd4

2 files changed, 5 insertions(+), 5 deletions(-)

jump to
M captcha_test.gocaptcha_test.go

@@ -6,18 +6,18 @@ "testing"

) 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 TestReload(t *testing.T) { - id := New(StdLength) + id := New() d1 := globalStore.Get(id, false) // cheating Reload(id) d2 := globalStore.Get(id, false) // cheating again
M store_test.gostore_test.go

@@ -43,7 +43,7 @@ for i := range ids {

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