1
1
/// A type representing the context in which a test is being run, _i.e._ either in Swift's native
2
2
/// Testing framework, or Xcode's XCTest framework.
3
- public enum TestContext {
3
+ public enum TestContext : Equatable {
4
4
/// The Swift Testing framework.
5
5
case swiftTesting( Testing ? )
6
6
@@ -29,7 +29,7 @@ public enum TestContext {
29
29
return . xcTest
30
30
}
31
31
}
32
-
32
+
33
33
/// Determines if the test context is Swift's native Testing framework.
34
34
public var isSwiftTesting : Bool {
35
35
guard case . swiftTesting = self
@@ -48,10 +48,8 @@ public enum TestContext {
48
48
}
49
49
}
50
50
}
51
- }
52
51
53
- @available ( * , deprecated, message: " Test for '.swiftTesting' using pattern matching, instead. " )
54
- extension TestContext : Equatable {
52
+ @available ( * , deprecated, message: " Test for '.swiftTesting' using pattern matching, instead. " )
55
53
public static func == ( lhs: Self , rhs: Self ) -> Bool {
56
54
switch ( lhs, rhs) {
57
55
case ( . swiftTesting( nil ) , . swiftTesting) ,
@@ -62,11 +60,10 @@ extension TestContext: Equatable {
62
60
return lhs == rhs
63
61
case ( . swiftTesting, . xcTest) , ( . xcTest, . swiftTesting) :
64
62
return false
65
- @unknown default :
66
- return false
67
63
}
68
64
}
69
65
66
+ @available ( * , deprecated, message: " Test for '.swiftTesting' using pattern matching, instead. " )
70
67
public static var swiftTesting : Self {
71
68
. swiftTesting( nil )
72
69
}
0 commit comments