summaryrefslogtreecommitdiff
path: root/tests/cracha.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cracha.go')
-rw-r--r--tests/cracha.go49
1 files changed, 48 insertions, 1 deletions
diff --git a/tests/cracha.go b/tests/cracha.go
index 10b82d7..9421a30 100644
--- a/tests/cracha.go
+++ b/tests/cracha.go
@@ -8,7 +8,6 @@ import (
"reflect"
"time"
- // "q"
"golite"
"guuid"
"scrypt"
@@ -355,6 +354,14 @@ func test_sendTokenStmt() {
}
g.TAssertEqual(tokens, expected)
})
+
+ g.Testing("no error when close()ing more than once", func() {
+ g.TErrorIf(g.SomeError(
+ sendTokenClose(),
+ sendTokenClose(),
+ sendTokenClose(),
+ ))
+ })
}
func test_confirmStmt() {
@@ -450,6 +457,14 @@ func test_confirmStmt() {
golite.ErrConstraintUnique,
)
})
+
+ g.Testing("no error when close()ing more than once", func() {
+ g.TErrorIf(g.SomeError(
+ confirmClose(),
+ confirmClose(),
+ confirmClose(),
+ ))
+ })
}
func test_byEmailStmt() {
@@ -517,6 +532,14 @@ func test_byEmailStmt() {
user2.confirmed = true
g.TAssertEqual(user2, user3)
})
+
+ g.Testing("no error when close()ing more than once", func() {
+ g.TErrorIf(g.SomeError(
+ byEmailClose(),
+ byEmailClose(),
+ byEmailClose(),
+ ))
+ })
}
func test_userByUUIDStmt() {
@@ -584,6 +607,14 @@ func test_userByUUIDStmt() {
user2.confirmed = true
g.TAssertEqual(user2, user3)
})
+
+ g.Testing("no error when close()ing more than once", func() {
+ g.TErrorIf(g.SomeError(
+ userByUUIDClose(),
+ userByUUIDClose(),
+ userByUUIDClose(),
+ ))
+ })
}
func test_loginStmt() {
@@ -728,6 +759,14 @@ func test_loginStmt() {
_, err = login(u.userID, guuid.New())
g.TErrorIf(err)
})
+
+ g.Testing("no error when close()ing more than once", func() {
+ g.TErrorIf(g.SomeError(
+ loginClose(),
+ loginClose(),
+ loginClose(),
+ ))
+ })
}
func test_refreshStmt() {
@@ -850,6 +889,14 @@ func test_refreshStmt() {
g.Testing("the sessionID can't be reused, even across users", func() {
})
// FIXME
+
+ g.Testing("no error when close()ing more than once", func() {
+ g.TErrorIf(g.SomeError(
+ refreshClose(),
+ refreshClose(),
+ refreshClose(),
+ ))
+ })
}
func test_resetStmt() {