-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finesse host application warning (#49)
* Finesse host application warning Just a lil cleanup work from #48. * wip * wip * wip * wip
- Loading branch information
1 parent
cdcc63c
commit ace2130
Showing
2 changed files
with
96 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 17 additions & 37 deletions
54
Tests/XCTestDynamicOverlayTests/HostAppDetectionTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,23 @@ | ||
import XCTest | ||
#if DEBUG && canImport(ObjectiveC) | ||
import XCTest | ||
|
||
@testable import XCTestDynamicOverlay | ||
@testable import XCTestDynamicOverlay | ||
|
||
final class HostAppCallStackTests: XCTestCase { | ||
func testIsAbleToDetectTest() { | ||
XCTAssertEqual( | ||
testCaseSubclass(callStackSymbols: Thread.callStackSymbols).map(ObjectIdentifier.init), | ||
ObjectIdentifier(HostAppCallStackTests.self) | ||
) | ||
} | ||
|
||
func testIsAbleToDetectAsyncTest() async { | ||
XCTAssertEqual( | ||
testCaseSubclass(callStackSymbols: Thread.callStackSymbols).map(ObjectIdentifier.init), | ||
ObjectIdentifier(HostAppCallStackTests.self) | ||
) | ||
} | ||
final class HostAppCallStackTests: XCTestCase { | ||
func testIsAbleToDetectTest() { | ||
XCTAssert(Thread.callStackSymbols.contains(where: isTestFrame)) | ||
} | ||
|
||
func testIsAbleToDetectThrowingTest() throws { | ||
XCTAssertEqual( | ||
testCaseSubclass(callStackSymbols: Thread.callStackSymbols).map(ObjectIdentifier.init), | ||
ObjectIdentifier(HostAppCallStackTests.self) | ||
) | ||
} | ||
func testIsAbleToDetectAsyncTest() async { | ||
XCTAssert(Thread.callStackSymbols.contains(where: isTestFrame)) | ||
} | ||
|
||
func testIsAbleToDetectAsyncThrowingTest() async throws { | ||
XCTAssertEqual( | ||
testCaseSubclass(callStackSymbols: Thread.callStackSymbols).map(ObjectIdentifier.init), | ||
ObjectIdentifier(HostAppCallStackTests.self) | ||
) | ||
} | ||
func testIsAbleToDetectThrowingTest() throws { | ||
XCTAssert(Thread.callStackSymbols.contains(where: isTestFrame)) | ||
} | ||
|
||
#if !os(Linux) | ||
func testFailDoesNotAppendHostAppWarningFromATest() { | ||
XCTExpectFailure { | ||
XCTestDynamicOverlay.XCTFail("foo") | ||
} issueMatcher: { | ||
$0.compactDescription == "foo" | ||
} | ||
func testIsAbleToDetectAsyncThrowingTest() async throws { | ||
XCTAssert(Thread.callStackSymbols.contains(where: isTestFrame)) | ||
} | ||
#endif | ||
} | ||
} | ||
#endif |