Created
October 17, 2017 19:45
-
-
Save sergiosette/2f5b04ef7b315714f5710b869a842bd8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func assert<T: Equatable>(_ json: String, parsesTo target: T) { | |
| guard let parsed = parser.parse(json) as? T else { XCTFail("Parsed item \(json) is not of type \(T.self)"); return } | |
| XCTAssertEqual(parsed, target) | |
| } | |
| func assertNil(_ json: String) { | |
| XCTAssertNil(parser.parse(json)) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment