mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-24 04:07:47 +00:00
28 lines
781 B
Swift
28 lines
781 B
Swift
import XCTest
|
|
#if USING_SQLCIPHER
|
|
import GRDBCipher
|
|
#elseif USING_CUSTOMSQLITE
|
|
import GRDBCustomSQLite
|
|
#else
|
|
import GRDB
|
|
#endif
|
|
|
|
class DatabaseWriterTests : GRDBTestCase {
|
|
|
|
func testDatabaseQueueAvailableDatabaseConnection() throws {
|
|
let dbQueue = try makeDatabaseQueue()
|
|
XCTAssertTrue(dbQueue.availableDatabaseConnection == nil)
|
|
dbQueue.inDatabase { db in
|
|
XCTAssertTrue(dbQueue.availableDatabaseConnection != nil)
|
|
}
|
|
}
|
|
|
|
func testDatabasePoolAvailableDatabaseConnection() throws {
|
|
let dbPool = try makeDatabasePool()
|
|
XCTAssertTrue(dbPool.availableDatabaseConnection == nil)
|
|
dbPool.write { db in
|
|
XCTAssertTrue(dbPool.availableDatabaseConnection != nil)
|
|
}
|
|
}
|
|
}
|