mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-24 04:07:47 +00:00
#664 is not quite easy to fix with optionals :-/
This commit is contained in:
1 parent
2b37e28691
commit
dfb013bf78
1 file changed
+20
@@ -1072,9 +1072,29 @@ extension FetchableRecordDecodableTests {
|
||||
let decoder = RowDecoder()
|
||||
do {
|
||||
_ = try decoder.decode(Composed.self, from: [:])
|
||||
XCTFail("Expected error")
|
||||
} catch let DecodingError.keyNotFound(key, context) {
|
||||
XCTAssertEqual(key.stringValue, "left")
|
||||
XCTAssertEqual(context.debugDescription, "No such key: left")
|
||||
}
|
||||
}
|
||||
|
||||
// This is a regression test for https://github.com/groue/GRDB.swift/issues/664
|
||||
// TODO: make this test pass
|
||||
// func testIllDecoding2() throws {
|
||||
// struct Left: Decodable { }
|
||||
// struct Right: Decodable { }
|
||||
// struct Composed: Decodable, FetchableRecord {
|
||||
// var left: Left
|
||||
// var right: Right?
|
||||
// }
|
||||
// let decoder = RowDecoder()
|
||||
// do {
|
||||
// _ = try decoder.decode(Composed.self, from: [:])
|
||||
// XCTFail("Expected error")
|
||||
// } catch let DecodingError.keyNotFound(key, context) {
|
||||
// XCTAssertEqual(key.stringValue, "left")
|
||||
// XCTAssertEqual(context.debugDescription, "No such key: left")
|
||||
// }
|
||||
// }
|
||||
}
|
||||
Reference in new issue
Block a user