Skip to content

Fix the build script run tests that were missed #161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Tests/Functional/Asynchronous/Expectations/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ExpectationsTestCase: XCTestCase {
let timer = Timer.scheduledTimer(withTimeInterval: 0.1, repeats: false) { _ in
expectation.fulfill()
}
RunLoop.current().add(timer, forMode: .defaultRunLoopMode)
RunLoop.current.add(timer, forMode: .defaultRunLoopMode)
waitForExpectations(timeout: 1.0)
}

Expand All @@ -59,7 +59,7 @@ class ExpectationsTestCase: XCTestCase {
let timer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: false) { _ in
expectation.fulfill()
}
RunLoop.current().add(timer, forMode: .defaultRunLoopMode)
RunLoop.current.add(timer, forMode: .defaultRunLoopMode)
waitForExpectations(timeout: 0.1)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class NotificationExpectationsTestCase: XCTestCase {
func test_observeNotificationWithName_passes() {
let notificationName = "notificationWithNameTest"
expectation(forNotification: notificationName, object:nil)
NotificationCenter.default.postNotificationName(Notification.Name(rawValue: notificationName), object: nil)
NotificationCenter.default.post(name: Notification.Name(rawValue: notificationName), object: nil)
waitForExpectations(timeout: 0.0)
}

Expand All @@ -31,7 +31,7 @@ class NotificationExpectationsTestCase: XCTestCase {
let notificationName = "notificationWithNameAndObjectTest"
let dummyObject = NSObject()
expectation(forNotification: notificationName, object:dummyObject)
NotificationCenter.default.postNotificationName(Notification.Name(rawValue: notificationName), object: dummyObject)
NotificationCenter.default.post(name: Notification.Name(rawValue: notificationName), object: dummyObject)
waitForExpectations(timeout: 0.0)
}

Expand All @@ -41,7 +41,7 @@ class NotificationExpectationsTestCase: XCTestCase {
let notificationName = "notificationWithNameAndObject_expectNoObjectTest"
expectation(forNotification: notificationName, object:nil)
let dummyObject = NSObject()
NotificationCenter.default.postNotificationName(Notification.Name(rawValue: notificationName), object: dummyObject)
NotificationCenter.default.post(name: Notification.Name(rawValue: notificationName), object: dummyObject)
waitForExpectations(timeout: 0.0)
}

Expand All @@ -50,7 +50,7 @@ class NotificationExpectationsTestCase: XCTestCase {
// CHECK: Test Case 'NotificationExpectationsTestCase.test_observeNotificationWithIncorrectName_fails' failed \(\d+\.\d+ seconds\).
func test_observeNotificationWithIncorrectName_fails() {
expectation(forNotification: "expectedName", object: nil)
NotificationCenter.default.postNotificationName(Notification.Name(rawValue: "actualName"), object: nil)
NotificationCenter.default.post(name: Notification.Name(rawValue: "actualName"), object: nil)
waitForExpectations(timeout: 0.1)
}

Expand All @@ -62,7 +62,7 @@ class NotificationExpectationsTestCase: XCTestCase {
let dummyObject: NSString = "dummyObject"
let anotherDummyObject = NSObject()
expectation(forNotification: notificationName, object: dummyObject)
NotificationCenter.default.postNotificationName(Notification.Name(rawValue: notificationName), object:anotherDummyObject)
NotificationCenter.default.post(name: Notification.Name(rawValue: notificationName), object:anotherDummyObject)
waitForExpectations(timeout: 0.1)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class NotificationHandlerTestCase: XCTestCase {
notification in
return false
})
NotificationCenter.default.postNotificationName(Notification.Name(rawValue: "returnFalse"), object: nil)
NotificationCenter.default.post(name: Notification.Name(rawValue: "returnFalse"), object: nil)
waitForExpectations(timeout: 0.1)
}

Expand All @@ -34,7 +34,7 @@ class NotificationHandlerTestCase: XCTestCase {
notification in
return true
})
NotificationCenter.default.postNotificationName(Notification.Name(rawValue: "returnTrue"), object: nil)
NotificationCenter.default.post(name: Notification.Name(rawValue: "returnTrue"), object: nil)
waitForExpectations(timeout: 0.1)
}

Expand All @@ -47,7 +47,7 @@ class NotificationHandlerTestCase: XCTestCase {
return true
})
waitForExpectations(timeout: 0.1, handler: nil)
NotificationCenter.default.postNotificationName(Notification.Name(rawValue: "note"), object: nil)
NotificationCenter.default.post(name: Notification.Name(rawValue: "note"), object: nil)
}

static var allTests = {
Expand Down
12 changes: 6 additions & 6 deletions Tests/Functional/Asynchronous/Predicates/Expectations/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
// CHECK: Test Suite '.*\.xctest' started at \d+:\d+:\d+\.\d+

// CHECK: Test Suite 'PredicateExpectationsTestCase' started at \d+:\d+:\d+\.\d+
class PredicateExpectationsTestCase: XCTestCase {
class NSPredicateExpectationsTestCase: XCTestCase {
// CHECK: Test Case 'PredicateExpectationsTestCase.test_immediatelyTruePredicateAndObject_passes' started at \d+:\d+:\d+\.\d+
// CHECK: Test Case 'PredicateExpectationsTestCase.test_immediatelyTruePredicateAndObject_passes' passed \(\d+\.\d+ seconds\).
func test_immediatelyTruePredicateAndObject_passes() {
let predicate = Predicate(value: true)
let predicate = NSPredicate(value: true)
let object = NSObject()
expectation(for: predicate, evaluatedWith: object)
waitForExpectations(timeout: 0.1)
}

// CHECK: Test Case 'PredicateExpectationsTestCase.test_immediatelyFalsePredicateAndObject_fails' started at \d+:\d+:\d+\.\d+
// CHECK: .*/Tests/Functional/Asynchronous/Predicates/Expectations/main.swift:[[@LINE+6]]: error: PredicateExpectationsTestCase.test_immediatelyFalsePredicateAndObject_fails : Asynchronous wait failed - Exceeded timeout of 0.1 seconds, with unfulfilled expectations: Expect `<Predicate: 0x[0-9A-Fa-f]{1,16}>` for object <NSObject: 0x[0-9A-Fa-f]{1,16}>
// CHECK: .*/Tests/Functional/Asynchronous/Predicates/Expectations/main.swift:[[@LINE+6]]: error: NSPredicateExpectationsTestCase.test_immediatelyFalsePredicateAndObject_fails : Asynchronous wait failed - Exceeded timeout of 0.1 seconds, with unfulfilled expectations: Expect `<Predicate: 0x[0-9A-Fa-f]{1,16}>` for object <NSObject: 0x[0-9A-Fa-f]{1,16}>
// CHECK: Test Case 'PredicateExpectationsTestCase.test_immediatelyFalsePredicateAndObject_fails' failed \(\d+\.\d+ seconds\).
func test_immediatelyFalsePredicateAndObject_fails() {
let predicate = Predicate(value: false)
let predicate = NSPredicate(value: false)
let object = NSObject()
expectation(for: predicate, evaluatedWith: object)
waitForExpectations(timeout: 0.1)
Expand All @@ -38,7 +38,7 @@ class PredicateExpectationsTestCase: XCTestCase {
// CHECK: Test Case 'PredicateExpectationsTestCase.test_delayedTruePredicateAndObject_passes' passed \(\d+\.\d+ seconds\).
func test_delayedTruePredicateAndObject_passes() {
var didEvaluate = false
let predicate = Predicate(block: { evaluatedObject, bindings in
let predicate = NSPredicate(block: { evaluatedObject, bindings in
defer { didEvaluate = true }
return didEvaluate
})
Expand All @@ -50,7 +50,7 @@ class PredicateExpectationsTestCase: XCTestCase {
// CHECK: Test Case 'PredicateExpectationsTestCase.test_immediatelyTrueDelayedFalsePredicateAndObject_passes' passed \(\d+\.\d+ seconds\).
func test_immediatelyTrueDelayedFalsePredicateAndObject_passes() {
var didEvaluate = false
let predicate = Predicate(block: { evaluatedObject, bindings in
let predicate = NSPredicate(block: { evaluatedObject, bindings in
defer { didEvaluate = true }
return !didEvaluate
})
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/Performance/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class PerformanceTestCase: XCTestCase {
// CHECK: .*/Performance/main.swift:[[@LINE+1]]: error: PerformanceTestCase.test_measuresWallClockTimeInBlock : failed: The relative standard deviation of the measurements is \d+.\d{3}% which is higher than the max allowed of \d+.\d{3}%.
measure {
if !hasWaited {
Thread.sleepForTimeInterval(1)
Thread.sleep(forTimeInterval: 1)
hasWaited = true
}
}
Expand Down