@@ -51,17 +51,17 @@ import Testing
5151 let parsedToolchains = lines. compactMap { outputLine in
5252#if !os(macOS)
5353 Set < ToolchainVersion > . allToolchains ( ) . first {
54- outputLine. contains ( String ( describing: $0) )
54+ outputLine. hasPrefix ( String ( describing: $0) )
5555 }
5656#else
5757 ( Set < ToolchainVersion > . allToolchains ( ) + [ . xcodeVersion] ) . first {
58- outputLine. contains ( String ( describing: $0) )
58+ outputLine. hasPrefix ( String ( describing: $0) )
5959 }
6060#endif
6161 }
6262
6363 // Ensure extra toolchains weren't accidentally included in the output.
64- guard parsedToolchains. count == lines. filter ( { $0. hasPrefix ( " Swift " ) || $0. contains ( " -snapshot " ) || $0. contains ( " xcode " ) } ) . count else {
64+ guard parsedToolchains. count == lines. filter ( { $0. hasPrefix ( " Swift " ) || $0. contains ( " -snapshot " ) || $0. hasPrefix ( " xcode " ) } ) . count else {
6565 throw SwiftlyTestError ( message: " unexpected listed toolchains in \( output) " )
6666 }
6767
@@ -182,13 +182,18 @@ import Testing
182182 #expect( toolchains == systemToolchains)
183183
184184 toolchains = try await self . runList ( selector: " 5 " )
185- #expect( toolchains == systemToolchains )
185+ #expect( toolchains == [ ] )
186186
187187 toolchains = try await self . runList ( selector: " main-snapshot " )
188- #expect( toolchains == systemToolchains )
188+ #expect( toolchains == [ ] )
189189
190190 toolchains = try await self . runList ( selector: " 5.7-snapshot " )
191+ #expect( toolchains == [ ] )
192+
193+ #if os(macOS)
194+ toolchains = try await self . runList ( selector: " xcode " )
191195 #expect( toolchains == systemToolchains)
196+ #endif
192197 }
193198 }
194199
@@ -204,7 +209,13 @@ import Testing
204209 from: output [ 0 ] . data ( using: . utf8) !
205210 )
206211
207- #expect( listInfo. toolchains. count == Set < ToolchainVersion > . allToolchains ( ) . count)
212+ #if !os(macOS)
213+ let systemToolchains : [ ToolchainVersion ] = [ ]
214+ #else
215+ let systemToolchains : [ ToolchainVersion ] = [ . xcodeVersion]
216+ #endif
217+
218+ #expect( listInfo. toolchains. count == Set < ToolchainVersion > . allToolchains ( ) . count + systemToolchains. count)
208219
209220 for toolchain in listInfo. toolchains {
210221 #expect( toolchain. version. name. isEmpty == false )
0 commit comments