Skip to content

Commit 5a30f29

Browse files
committed
cleanup test for Statement.reset()
1 parent 7b3de3d commit 5a30f29

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

Tests/SQLiteTests/StatementTests.swift

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,8 @@ class StatementTests: SQLiteTestCase {
3737

3838
/// Check that a statement reset will close the implicit transaction, allowing wal file to checkpoint
3939
func test_reset_statement() throws {
40-
// Remove old test db if any
41-
let path = temporaryFile() + ".sqlite3"
42-
try? FileManager.default.removeItem(atPath: path)
43-
try? FileManager.default.removeItem(atPath: path + "-shm")
44-
try? FileManager.default.removeItem(atPath: path + "-wal")
45-
4640
// create new db on disk in wal mode
41+
let path = temporaryFile() + ".sqlite3"
4742
let db = try Connection(.uri(path))
4843
try db.run("PRAGMA journal_mode=WAL;")
4944

@@ -70,9 +65,7 @@ class StatementTests: SQLiteTestCase {
7065
// prevents the implicit transaction from closing.
7166
// https://www.sqlite.org/lang_transaction.html#implicit_versus_explicit_transactions
7267
let statement = try db.prepare("SELECT email FROM users")
73-
XCTAssert(try statement.step())
74-
let blob = statement.row[0] as Blob
75-
XCTAssertEqual("[email protected]", String(bytes: blob.bytes, encoding: .utf8)!)
68+
_ = try statement.step()
7669

7770
// verify that the transaction is not closed, which prevents wal_checkpoints (both explicit and auto)
7871
do {

0 commit comments

Comments
 (0)