diff options
author | EuAndreh <eu@euandre.org> | 2024-11-14 00:24:53 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-11-14 00:24:53 -0300 |
commit | e7b379ed40f3695d091c0c5fba1803ac7ea5b1d5 (patch) | |
tree | 3cc51ed422049bac25d7aa0f9ce21a86f0ac0138 /tests/cracha.go | |
parent | tests/cracha.go: Include userByUUIDSQL() on dumpQueries() output (diff) | |
download | cracha-e7b379ed40f3695d091c0c5fba1803ac7ea5b1d5.tar.gz cracha-e7b379ed40f3695d091c0c5fba1803ac7ea5b1d5.tar.xz |
Add some XXXClose() tests
Diffstat (limited to 'tests/cracha.go')
-rw-r--r-- | tests/cracha.go | 49 |
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() { |