@@ -12,14 +12,27 @@ struct InterfaceIdiomTests {
12
12
#if os(iOS) || os(tvOS)
13
13
@Test
14
14
func interfaceIdiom( ) throws {
15
+ #if OPENSWIFTUI_RELEASE_2021
16
+ #expect( UIUserInterfaceIdiom . unspecified. idiom == nil )
17
+ #expect( UIUserInterfaceIdiom . phone. idiom == AnyInterfaceIdiomType . phone)
18
+ #expect( UIUserInterfaceIdiom . pad. idiom == AnyInterfaceIdiomType . pad)
19
+ #expect( UIUserInterfaceIdiom . tv. idiom == AnyInterfaceIdiomType . tv)
20
+ #expect( UIUserInterfaceIdiom . carPlay. idiom == AnyInterfaceIdiomType . carplay)
21
+ #expect( UIUserInterfaceIdiom ( rawValue: 4 ) ? . idiom == AnyInterfaceIdiomType . watch)
22
+ #expect( UIUserInterfaceIdiom . mac. idiom == AnyInterfaceIdiomType . mac)
23
+ if #available( iOS 17 , tvOS 17 , * ) {
24
+ #expect( UIUserInterfaceIdiom . vision. idiom == AnyInterfaceIdiomType . vision)
25
+ }
26
+ #elseif OPENSWIFTUI_RELEASE_2024
15
27
#expect( UIUserInterfaceIdiom . unspecified. idiom == nil )
16
28
#expect( UIUserInterfaceIdiom . phone. idiom == AnyInterfaceIdiom ( . phone) )
17
29
#expect( UIUserInterfaceIdiom . pad. idiom == AnyInterfaceIdiom ( . pad) )
18
30
#expect( UIUserInterfaceIdiom . tv. idiom == AnyInterfaceIdiom ( . tv) )
19
31
#expect( UIUserInterfaceIdiom . carPlay. idiom == AnyInterfaceIdiom ( . carPlay) )
20
32
#expect( UIUserInterfaceIdiom ( rawValue: 4 ) ? . idiom == AnyInterfaceIdiom ( . watch) )
21
- #expect( UIUserInterfaceIdiom . carPlay . idiom == AnyInterfaceIdiom ( . carPlay ) )
33
+ #expect( UIUserInterfaceIdiom . mac . idiom == AnyInterfaceIdiom ( . mac ) )
22
34
#expect( UIUserInterfaceIdiom . vision. idiom == AnyInterfaceIdiom ( . vision) )
35
+ #endif
23
36
}
24
37
#endif
25
38
}
0 commit comments