remove AbsolutePath.exists

This commit is contained in:
omochimetaru 2024-05-22 22:06:55 +09:00
parent 9c89fe7847
commit a599a50532
2 changed files with 3 additions and 5 deletions

View File

@ -22,6 +22,8 @@ import XCTest
final class BundleCommandTests: XCTestCase {
func testWithNoArguments() async throws {
let fs = localFileSystem
try await withFixture("EchoExecutable") { packageDirectory in
let bundleDirectory = packageDirectory.appending(component: "Bundle")
@ -29,7 +31,7 @@ final class BundleCommandTests: XCTestCase {
try result.checkNonZeroExit()
// Confirm that the files are actually in the folder
XCTAssertTrue(bundleDirectory.exists, "The Bundle directory should exist")
XCTAssertTrue(fs.isDirectory(bundleDirectory), "The Bundle directory should exist")
XCTAssertTrue(bundleDirectory.ls().contains("index.html"), "Bundle does not have index.html")
XCTAssertFalse(
(bundleDirectory.ls().filter { $0.contains("wasm") }).isEmpty,

View File

@ -58,10 +58,6 @@ func withFixture(_ name: String, _ body: (AbsolutePath) async throws -> Void) as
}
extension AbsolutePath {
var exists: Bool {
FileManager.default.fileExists(atPath: pathString)
}
func ls() -> [String] {
guard let paths = try? FileManager.default.subpathsOfDirectory(atPath: pathString)
else { return [] }