|
@@ -59,21 +59,21 @@ 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")
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- #if os(iOS) || os(tvOS)
|
|
|
|
|
|
|
+
|
|
|
func testGuideMakeConstraints() {
|
|
func testGuideMakeConstraints() {
|
|
|
- guard #available(iOS 9.0, *) else { return }
|
|
|
|
|
|
|
+ guard #available(iOS 9.0, OSX 10.11, *) else { return }
|
|
|
let v1 = View()
|
|
let v1 = View()
|
|
|
- let g1 = UILayoutGuide()
|
|
|
|
|
|
|
+
|
|
|
|
|
+ let g1 = ConstraintLayoutGuide()
|
|
|
self.container.addSubview(v1)
|
|
self.container.addSubview(v1)
|
|
|
self.container.addLayoutGuide(g1)
|
|
self.container.addLayoutGuide(g1)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
v1.snp.makeConstraints { (make) -> Void in
|
|
v1.snp.makeConstraints { (make) -> Void in
|
|
|
- make.top.equalTo(g1.snp.top).offset(50)
|
|
|
|
|
|
|
+ make.top.equalTo(g1).offset(50)
|
|
|
make.left.equalTo(g1.snp.top).offset(50)
|
|
make.left.equalTo(g1.snp.top).offset(50)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
XCTAssertEqual(self.container.snp_constraints.count, 2, "Should have 2 constraints installed")
|
|
XCTAssertEqual(self.container.snp_constraints.count, 2, "Should have 2 constraints installed")
|
|
|
|
|
|
|
|
g1.snp.makeConstraints { (make) -> Void in
|
|
g1.snp.makeConstraints { (make) -> Void in
|
|
@@ -83,8 +83,7 @@ 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")
|
|
|
}
|
|
}
|
|
|
- #endif
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
func testMakeImpliedSuperviewConstraints() {
|
|
func testMakeImpliedSuperviewConstraints() {
|
|
|
let v1 = View()
|
|
let v1 = View()
|
|
|
let v2 = View()
|
|
let v2 = View()
|
|
@@ -130,7 +129,6 @@ class SnapKitTests: XCTestCase {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
func testRemakeConstraints() {
|
|
func testRemakeConstraints() {
|
|
|
let v1 = View()
|
|
let v1 = View()
|
|
|
let v2 = View()
|
|
let v2 = View()
|