Skip to content

Commit 3c4ff5b

Browse files
committed
Single test for strict tables
Also, skip the test for old SQLCipher version.
1 parent 2ade133 commit 3c4ff5b

File tree

1 file changed

+10
-28
lines changed

1 file changed

+10
-28
lines changed

Tests/GRDBTests/TableDefinitionTests.swift

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -46,34 +46,16 @@ class TableDefinitionTests: GRDBTestCase {
4646
}
4747
}
4848

49-
#if GRDBCUSTOMSQLITE || GRDBCIPHER
50-
func testStrictTableCreationOptionCustomAndCipher() throws {
51-
let dbQueue = try makeDatabaseQueue()
52-
try dbQueue.inDatabase { db in
53-
try db.create(table: "test3", options: [.strict]) { t in
54-
t.column("id", .integer).primaryKey()
55-
t.column("a", .integer)
56-
t.column("b", .real)
57-
t.column("c", .text)
58-
t.column("d", .blob)
59-
t.column("e", .any)
60-
}
61-
assertEqualSQL(lastSQLQuery!, """
62-
CREATE TABLE "test3" (\
63-
"id" INTEGER PRIMARY KEY, \
64-
"a" INTEGER, \
65-
"b" REAL, \
66-
"c" TEXT, \
67-
"d" BLOB, \
68-
"e" ANY\
69-
) STRICT
70-
""")
71-
}
72-
}
73-
#endif
74-
75-
@available(iOS 15.4, macOS 12.4, tvOS 15.4, watchOS 8.5, *)
7649
func testStrictTableCreationOption() throws {
50+
guard sqlite3_libversion_number() >= 3037000 else {
51+
throw XCTSkip("STRICT tables are not available")
52+
}
53+
#if !GRDBCUSTOMSQLITE && !GRDBCIPHER
54+
guard #available(iOS 15.4, macOS 12.4, tvOS 15.4, watchOS 8.5, *) else {
55+
throw XCTSkip("STRICT tables are not available")
56+
}
57+
#endif
58+
7759
let dbQueue = try makeDatabaseQueue()
7860
try dbQueue.inDatabase { db in
7961
try db.create(table: "test3", options: [.strict]) { t in
@@ -96,7 +78,7 @@ class TableDefinitionTests: GRDBTestCase {
9678
""")
9779
}
9880
}
99-
81+
10082
func testColumnLiteral() throws {
10183
let dbQueue = try makeDatabaseQueue()
10284
try dbQueue.inDatabase { db in

0 commit comments

Comments
 (0)