Skip to content

Commit 44e6cd0

Browse files
committed
Test was missing a proper return
The exception being thrown is the desired outcome, that the reflector dump fails afterwards is expected, I suppose? Maybe there is a deeper issue with the unowned `entity` in the `ModelRelationship`.
1 parent d71f343 commit 44e6cd0

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Tests/ZeeQLTests/CodableModelTests.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ class CodableModelTests: XCTestCase {
900900
}
901901

902902
func testSchemaWithToOneInlineCycle() {
903-
// TODO: this needs to throw - w/o optional this can't create
903+
// This needs to throw - w/o optional this can't create
904904

905905
class Person : CodableObjectType {
906906
var firstname : String
@@ -925,6 +925,7 @@ class CodableModelTests: XCTestCase {
925925
catch let error as CodableModelDecoder.Error {
926926
if case .reflectionDepthExceeded = error {
927927
// good
928+
return
928929
}
929930
else {
930931
XCTFail("unexpected error: \(error)")
@@ -937,7 +938,8 @@ class CodableModelTests: XCTestCase {
937938

938939
// we should never get here
939940
let model = reflector.buildModel()
940-
model.dump()
941+
model.dump() // crashes on unowned reference in -description
942+
XCTFail("Reached unexpected point")
941943
}
942944

943945
func testSchemaWithOptionalToOneInlineCycle() {

0 commit comments

Comments
 (0)