in Legacy/PlaygroundLogger/PlaygroundLogger/TestCases.swift [503:529]
func doTest() {
class Parent { var a = 1; var b = 2 }
class Child : Parent { var c = 3 }
let object = Child()
let logdata = playground_log_impl(object, "object", TestHelpers.defaultSourceRange())
let decoded = TestHelpers.unwrapOrFail( playground_log_decode(logdata) )
let structured = TestHelpers.unwrapOrFail( decoded.object as? PlaygroundDecodedObject_Structured )
var seen_parent = false
var seen_a = false
var seen_b = false
var seen_c = false
for child in structured.children {
if let structured_child = child as? PlaygroundDecodedObject_Structured {
if structured_child.name == "super" {
seen_parent = true
for parent_child in structured_child.children {
if parent_child.name == "a" { seen_a = true }
if parent_child.name == "b" { seen_b = true }
}
}
}
if child.name == "c" {
seen_c = true
}
}
expectTrue(seen_parent && seen_a && seen_b && seen_c)
}