Skip to content

Commit 0a8bbe6

Browse files
authored
Replace usage of XCTUnrwap (#19)
1 parent 5357b07 commit 0a8bbe6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Tests/XMLCoderTests/Minimal/BoxTreeTests.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@ class BoxTreeTests: XCTestCase {
2828
elements: [e1, e2],
2929
attributes: []
3030
)
31-
32-
let boxTree = try XCTUnwrap(root.transformToBoxTree() as? KeyedBox)
33-
let foo = try XCTUnwrap(boxTree.elements["foo"])
34-
31+
// FIXME: Use `XCTUnwrap` when commonly available
32+
guard let boxTree = root.transformToBoxTree() as? KeyedBox else {
33+
XCTFail("boxtTree is not a KeyedBox");
34+
return
35+
}
36+
let foo = boxTree.elements["foo"]
3537
XCTAssertEqual(foo.count, 2)
3638
}
3739
}

0 commit comments

Comments
 (0)