File tree Expand file tree Collapse file tree
Tests/StructuredQueriesTests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import Dependencies
22import Foundation
33import InlineSnapshotTesting
4- import SQLite3
54import StructuredQueries
65import StructuredQueriesSQLite
76import StructuredQueriesTestSupport
87import Testing
98import _StructuredQueriesSQLite
109
10+ #if canImport(Darwin)
11+ import SQLite3
12+ #else
13+ import _StructuredQueriesSQLite3
14+ #endif
15+
1116extension SnapshotTests {
1217 @Suite struct DatabaseCollationTests {
1318 @Dependency ( \. defaultDatabase) var database
@@ -66,16 +71,15 @@ extension SnapshotTests {
6671 }
6772 }
6873 @Test func deallocatedOwner( ) {
69- func makeCollation( ) -> some DatabaseCollation {
70- Engine ( ) . $reversed
71- }
72- let collation = makeCollation ( )
73- collation. install ( database. handle)
74+ var engines = [ Engine ( ) ]
75+ let reversed = engines [ 0 ] . $reversed
76+ reversed. install ( database. handle)
77+ engines. removeAll ( )
7478 // NB: A collating sequence cannot surface an error to SQLite, so the deallocated engine is
7579 // reported as an issue and the comparison falls back to a byte-wise one.
7680 withKnownIssue {
7781 assertQuery (
78- RemindersList . select ( \. title) . order { $0. title. collate ( collation ) }
82+ RemindersList . select ( \. title) . order { $0. title. collate ( reversed ) }
7983 ) {
8084 """
8185 SELECT " remindersLists " . " title "
You can’t perform that action at this time.
0 commit comments