Skip to content

Commit

Permalink
Make unit test more robust
Browse files Browse the repository at this point in the history
Return comma separated list of Temporary*.swift
  • Loading branch information
pcbeard committed Oct 19, 2021
1 parent 7c8a383 commit f63cdf6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Tests/PackageLoadingTests/PD_5_6_LoadingTests.swift
Expand Up @@ -179,12 +179,13 @@ class PackageDescription5_6LoadingTests: PackageDescriptionLoadingTests {
let contents = (try? fileManager.contentsOfDirectory(atPath: Context.packageDirectory)) ?? []
let swiftFiles = contents.filter { $0.hasPrefix("TemporaryFile") && $0.hasSuffix(".swift") }
let package = Package(name: swiftFiles[0])
let package = Package(name: swiftFiles.joined(separator: ","))
"""

loadManifest(stream.bytes) { manifest in
let name = parsedManifest?.components.last ?? ""
XCTAssertEqual(manifest.name, name)
let swiftFiles = manifest.name.split(separator: ",").map(String.init)
XCTAssertNotNil(swiftFiles.firstIndex(of: name))
}
}
}

0 comments on commit f63cdf6

Please sign in to comment.