@@ -10,36 +10,43 @@ struct ButtonTests {
1010 typealias PlatformButton = NSButton
1111 #endif
1212
13- @Test func introspect( ) async throws {
13+ @available ( macOS, introduced: 10.15 , obsoleted: 26.0 )
14+ @Test func introspectButtonsBeforeMacOS26( ) async throws {
1415 let ( entity1, entity2, entity3, entity4) = try await introspection ( of: PlatformButton . self) { spy1, spy2, spy3, spy4 in
1516 VStack {
16- Button ( " Button 0 " , action: { } )
17+ Button ( " Plain Button " , action: { } )
18+ . introspect ( . button, on: . macOS( . v10_15, . v11, . v12, . v13, . v14, . v15) , customize: spy1)
19+
20+ Button ( " Bordered Button " , action: { } )
1721 . buttonStyle ( . bordered)
18- #if os(macOS)
19- . introspect( . button, on: . macOS( . v10_15, . v11, . v12, . v13, . v14, . v15, . v26) , customize: spy1)
20- #endif
22+ . introspect ( . button, on: . macOS( . v10_15, . v11, . v12, . v13, . v14, . v15) , customize: spy2)
2123
22- Button ( " Button 1 " , action: { } )
24+ Button ( " Borderless Button " , action: { } )
2325 . buttonStyle ( . borderless)
24- #if os(macOS)
25- . introspect( . button, on: . macOS( . v10_15, . v11, . v12, . v13, . v14, . v15, . v26) , customize: spy2)
26- #endif
26+ . introspect ( . button, on: . macOS( . v10_15, . v11, . v12, . v13, . v14, . v15) , customize: spy3)
2727
28- Button ( " Button 2 " , action: { } )
28+ Button ( " Link Button " , action: { } )
2929 . buttonStyle ( . link)
30- #if os(macOS)
31- . introspect( . button, on: . macOS( . v10_15, . v11, . v12, . v13, . v14, . v15, . v26) , customize: spy3)
32- #endif
33-
34- Button ( " Button 3 " , action: { } )
35- #if os(macOS)
36- . introspect( . button, on: . macOS( . v10_15, . v11, . v12, . v13, . v14, . v15, . v26) , customize: spy4)
37- #endif
30+ . introspect ( . button, on: . macOS( . v10_15, . v11, . v12, . v13, . v14, . v15) , customize: spy4)
3831 }
3932 }
40- #if canImport(AppKit)
4133 #expect( Set ( [ entity1, entity2, entity3, entity4] . map ( ObjectIdentifier . init) ) . count == 4 )
42- #endif
34+ }
35+
36+ @available ( macOS 26 , * )
37+ @Test func introspectButtonsOnMacOS26( ) async throws {
38+ let ( entity1, entity2) = try await introspection ( of: NSButton . self) { spy1, spy2 in
39+ VStack {
40+ Button ( " Borderless Button " , action: { } )
41+ . buttonStyle ( . borderless)
42+ . introspect ( . button, on: . macOS( . v26) , customize: spy1)
43+
44+ Button ( " Link Button " , action: { } )
45+ . buttonStyle ( . link)
46+ . introspect ( . button, on: . macOS( . v26) , customize: spy2)
47+ }
48+ }
49+ #expect( Set ( [ entity1, entity2] . map ( ObjectIdentifier . init) ) . count == 2 )
4350 }
4451}
4552#endif
0 commit comments