1
1
mirror of https://github.com/exyte/Macaw.git synced 2024-09-21 01:47:44 +03:00
Macaw/MacawTests/TestUtils.swift
2018-05-21 18:23:26 +07:00

23 lines
684 B
Swift

import Foundation
import Macaw
class TestUtils {
class func compareWithReferenceObject(_ fileName: String, referenceObject: AnyObject) -> Bool {
// TODO: this needs to be replaced with SVG tests
return true
}
class func prepareParametersList(_ mirror: Mirror) -> [(String, String)] {
var result: [(String, String)] = []
for (_, attribute) in mirror.children.enumerated() {
if let label = attribute.label , (label == "_value" || label.first != "_") && label != "contentsVar" {
result.append((label, String(describing: attribute.value)))
result.append(contentsOf: prepareParametersList(Mirror(reflecting: attribute.value)))
}
}
return result
}
}