Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
stephencelis committed Jul 10, 2024
1 parent eeb107e commit bcd9119
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 39 deletions.
60 changes: 30 additions & 30 deletions Tests/XCTestDynamicOverlayTests/XCTExpectFailureTests.swift
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
//import XCTest
//
//#if canImport(ObjectiveC)
// final class XCTExpectFailureTests: XCTestCase {
// func testXCTDynamicOverlayWithBlockShouldFail() async throws {
// MyXCTExpectFailure("This is expected to pass.", strict: false) {
// XCTAssertEqual(42, 42)
// }
//
// MyXCTExpectFailure("This is expected to pass.", strict: true) {
// XCTAssertEqual(42, 1729)
// } issueMatcher: {
// $0.compactDescription == #"XCTAssertEqual failed: ("42") is not equal to ("1729")"#
// }
//
// if ProcessInfo.processInfo.environment["TEST_FAILURE"] != nil {
// MyXCTExpectFailure("This is expected to fail!", strict: true) {
// XCTAssertEqual(42, 42)
// }
// }
// }
//
// func testXCTDynamicOverlayShouldFail() async throws {
// MyXCTExpectFailure("This is expected to pass.", strict: true) {
// $0.compactDescription == #"XCTAssertEqual failed: ("42") is not equal to ("1729")"#
// }
// XCTAssertEqual(42, 1729)
// }
// }
//#endif
import XCTest

#if canImport(ObjectiveC)
final class XCTExpectFailureTests: XCTestCase {
func testXCTDynamicOverlayWithBlockShouldFail() async throws {
MyXCTExpectFailure("This is expected to pass.", strict: false) {
XCTAssertEqual(42, 42)
}

MyXCTExpectFailure("This is expected to pass.", strict: true) {
XCTAssertEqual(42, 1729)
} issueMatcher: {
$0.compactDescription == #"XCTAssertEqual failed: ("42") is not equal to ("1729")"#
}

if ProcessInfo.processInfo.environment["TEST_FAILURE"] != nil {
MyXCTExpectFailure("This is expected to fail!", strict: true) {
XCTAssertEqual(42, 42)
}
}
}

func testXCTDynamicOverlayShouldFail() async throws {
MyXCTExpectFailure("This is expected to pass.", strict: true) {
$0.compactDescription == #"XCTAssertEqual failed: ("42") is not equal to ("1729")"#
}
XCTAssertEqual(42, 1729)
}
}
#endif
18 changes: 9 additions & 9 deletions Tests/XCTestDynamicOverlayTests/XCTFailTests.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//import XCTest
//
//final class XCTFailTests: XCTestCase {
// func testXCTFailShouldFail() async throws {
// if ProcessInfo.processInfo.environment["TEST_FAILURE"] != nil {
// MyXCTFail("This is expected to fail!")
// }
// }
//}
import XCTest

final class XCTFailTests: XCTestCase {
func testXCTFailShouldFail() async throws {
if ProcessInfo.processInfo.environment["TEST_FAILURE"] != nil {
MyXCTFail("This is expected to fail!")
}
}
}

0 comments on commit bcd9119

Please sign in to comment.