in PlaygroundLogger/PlaygroundLoggerTests/LegacyPlaygroundLoggerTests.swift [539:578]
func testEnumSummary_Generic() {
typealias GEither = EnumSummaryTestCase_GEither<Int,String>
let t1 = GEither.First(1)
let t2 = GEither.Second("A")
let t3 = GEither.Neither
let logdata_t1 = legacyLog(instance: t1, name: "t1", id: 0, startLine: 0, endLine: 0, startColumn: 0, endColumn: 0) as! NSData
let logdata_t2 = legacyLog(instance: t2, name: "t2", id: 0, startLine: 0, endLine: 0, startColumn: 0, endColumn: 0) as! NSData
let logdata_t3 = legacyLog(instance: t3, name: "t3", id: 0, startLine: 0, endLine: 0, startColumn: 0, endColumn: 0) as! NSData
guard let decoded_t1 = legacyLogDecode(logdata_t1) else {
XCTFail("Failed to decode log data")
return
}
guard let decoded_t2 = legacyLogDecode(logdata_t2) else {
XCTFail("Failed to decode log data")
return
}
guard let decoded_t3 = legacyLogDecode(logdata_t3) else {
XCTFail("Failed to decode log data")
return
}
guard let structured_t1 = decoded_t1.object as? PlaygroundDecodedObject_Structured else {
XCTFail("Decoded object is not structured")
return
}
guard let structured_t2 = decoded_t2.object as? PlaygroundDecodedObject_Structured else {
XCTFail("Decoded object is not structured")
return
}
guard let structured_t3 = decoded_t3.object as? PlaygroundDecodedObject_Structured else {
XCTFail("Decoded object is not structured")
return
}
XCTAssertEqual(structured_t1.summary, "First(1)")
XCTAssertEqual(structured_t2.summary, "Second(\"A\")")
XCTAssertEqual(structured_t3.summary, "Neither")
}