Skip to content

Commit d9b468a

Browse files
committed
add test
1 parent a135af1 commit d9b468a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Tests/SharingGRDBTests/FetchOneTests.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,18 @@ import Testing
169169
#expect($id.loadError == nil)
170170
}
171171

172-
@Test func fetchOneOptionalWithStructurdQueriesFind() async throws {
172+
@Test func fetchOneOptional() async throws {
173173
@FetchOne(Record.find(1)) var record: Record?
174174
#expect(record != nil)
175175
try await $record.load(Record.find(1))
176176
#expect(record != nil)
177177
}
178+
179+
@Test func fetchOneDelayedAssignment() async throws {
180+
@FetchOne var record: Record
181+
_record = FetchOne(wrappedValue: Record(id: 0), Record.all)
182+
#expect(record.id == 1)
183+
}
178184
}
179185

180186
@Table

0 commit comments

Comments
 (0)