1
1
mirror of https://github.com/exyte/Macaw.git synced 2024-11-04 00:39:57 +03:00
Macaw/MacawTests/TestUtils.swift
2019-05-29 16:44:06 +07:00

29 lines
759 B
Swift

import Foundation
#if os(OSX)
@testable import MacawOSX
#endif
#if os(iOS)
@testable import Macaw
#endif
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
}
}