Skip to content

Instantly share code, notes, and snippets.

@bsneed
Created November 16, 2015 17:56
Show Gist options
  • Save bsneed/944c9f9c460b5550e7cf to your computer and use it in GitHub Desktop.
Save bsneed/944c9f9c460b5550e7cf to your computer and use it in GitHub Desktop.
Some unit test code to compare coconut against Argo and By_Hand decoding.
func test_measure_coconut() {
let json = THGCodable.JSON(bundleClass: TestingStuffTests.self, filename: "test.json")
measureBlock {
let array = json?.array
if let array = array {
let _: [Person] = array.map { object in
let jsonPerson = object as THGCodable.JSON
return try! Person.decode(jsonPerson)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment