mirror of https://github.com/SnapKit/SnapKit
Add platform check for UILayoutGuide test. (#366)
This commit is contained in:
parent
6ef7fca953
commit
3ce0d32bce
|
@ -60,9 +60,10 @@ class SnapKitTests: XCTestCase {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if os(iOS) || os(tvOS)
|
||||||
func testGuideMakeConstraints() {
|
func testGuideMakeConstraints() {
|
||||||
|
guard #available(iOS 9.0, *) else { return }
|
||||||
let v1 = View()
|
let v1 = View()
|
||||||
if #available(iOS 9.0, *) {
|
|
||||||
let g1 = UILayoutGuide()
|
let g1 = UILayoutGuide()
|
||||||
self.container.addSubview(v1)
|
self.container.addSubview(v1)
|
||||||
self.container.addLayoutGuide(g1)
|
self.container.addLayoutGuide(g1)
|
||||||
|
@ -81,12 +82,8 @@ class SnapKitTests: XCTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
XCTAssertEqual(self.container.snp_constraints.count, 6, "Should have 6 constraints installed")
|
XCTAssertEqual(self.container.snp_constraints.count, 6, "Should have 6 constraints installed")
|
||||||
|
|
||||||
} else {
|
|
||||||
XCTAssertTrue(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
func testMakeImpliedSuperviewConstraints() {
|
func testMakeImpliedSuperviewConstraints() {
|
||||||
let v1 = View()
|
let v1 = View()
|
||||||
|
|
Loading…
Reference in New Issue