remove AbsolutePath.url

This commit is contained in:
omochimetaru 2024-05-22 21:55:16 +09:00
parent 078f1edf58
commit c678563026
3 changed files with 12 additions and 16 deletions

View File

@ -25,7 +25,7 @@ final class BundleCommandTests: XCTestCase {
try await withFixture("EchoExecutable") { packageDirectory in
let bundleDirectory = packageDirectory.appending(component: "Bundle")
let result = try await swiftRun(["carton", "bundle"], packageDirectory: packageDirectory.url)
let result = try await swiftRun(["carton", "bundle"], packageDirectory: packageDirectory.asURL)
try result.checkNonZeroExit()
// Confirm that the files are actually in the folder
@ -45,7 +45,7 @@ final class BundleCommandTests: XCTestCase {
func testWithDebugInfo() async throws {
try await withFixture("EchoExecutable") { packageDirectory in
let result = try await swiftRun(
["carton", "bundle", "--debug-info"], packageDirectory: packageDirectory.url
["carton", "bundle", "--debug-info"], packageDirectory: packageDirectory.asURL
)
try result.checkNonZeroExit()
@ -64,7 +64,7 @@ final class BundleCommandTests: XCTestCase {
func testWithoutContentHash() async throws {
try await withFixture("EchoExecutable") { packageDirectory in
let result = try await swiftRun(
["carton", "bundle", "--no-content-hash", "--wasm-optimizations", "none"], packageDirectory: packageDirectory.url
["carton", "bundle", "--no-content-hash", "--wasm-optimizations", "none"], packageDirectory: packageDirectory.asURL
)
try result.checkNonZeroExit()
@ -84,7 +84,7 @@ final class BundleCommandTests: XCTestCase {
let result = try await swiftRun(
["carton", "bundle", "--wasm-optimizations", wasmOptimizations.rawValue],
packageDirectory: packageDirectory.url
packageDirectory: packageDirectory.asURL
)
try result.checkNonZeroExit()

View File

@ -35,7 +35,7 @@ final class TestCommandTests: XCTestCase {
func testWithNoArguments() async throws {
try await withFixture(Constants.testAppPackageName) { packageDirectory in
let result = try await swiftRun(
["carton", "test"], packageDirectory: packageDirectory.url
["carton", "test"], packageDirectory: packageDirectory.asURL
)
try result.checkNonZeroExit()
}
@ -44,7 +44,7 @@ final class TestCommandTests: XCTestCase {
func testEnvironmentNodeNoJSKit() async throws {
try await withFixture(Constants.testAppPackageName) { packageDirectory in
let result = try await swiftRun(
["carton", "test", "--environment", "node"], packageDirectory: packageDirectory.url
["carton", "test", "--environment", "node"], packageDirectory: packageDirectory.asURL
)
try result.checkNonZeroExit()
}
@ -53,7 +53,7 @@ final class TestCommandTests: XCTestCase {
func testEnvironmentNodeJSKit() async throws {
try await withFixture(Constants.nodeJSKitPackageName) { packageDirectory in
let result = try await swiftRun(
["carton", "test", "--environment", "node"], packageDirectory: packageDirectory.url
["carton", "test", "--environment", "node"], packageDirectory: packageDirectory.asURL
)
try result.checkNonZeroExit()
}
@ -62,7 +62,7 @@ final class TestCommandTests: XCTestCase {
func testSkipBuild() async throws {
try await withFixture(Constants.nodeJSKitPackageName) { packageDirectory in
var result = try await swiftRun(
["carton", "test", "--environment", "node"], packageDirectory: packageDirectory.url
["carton", "test", "--environment", "node"], packageDirectory: packageDirectory.asURL
)
try result.checkNonZeroExit()
@ -72,7 +72,7 @@ final class TestCommandTests: XCTestCase {
"--prebuilt-test-bundle-path",
"./.build/carton/wasm32-unknown-wasi/debug/NodeJSKitTestPackageTests.wasm",
],
packageDirectory: packageDirectory.url
packageDirectory: packageDirectory.asURL
)
try result.checkNonZeroExit()
}
@ -86,7 +86,7 @@ final class TestCommandTests: XCTestCase {
try await withFixture(Constants.testAppPackageName) { packageDirectory in
let result = try await swiftRun(
["carton", "test", "--environment", "browser", "--headless"],
packageDirectory: packageDirectory.url
packageDirectory: packageDirectory.asURL
)
try result.checkNonZeroExit()
}
@ -109,7 +109,7 @@ final class TestCommandTests: XCTestCase {
try await withFixture(fixture) { packageDirectory in
let result = try await swiftRun(
["carton", "test", "--environment", "browser", "--headless"],
packageDirectory: packageDirectory.url
packageDirectory: packageDirectory.asURL
)
try result.checkNonZeroExit()
}
@ -134,7 +134,7 @@ final class TestCommandTests: XCTestCase {
// FIXME: Don't assume a specific port is available since it can be used by others or tests
let result = try await swiftRun(
["carton", "test", "--environment", "browser", "--port", "8082"],
packageDirectory: packageDirectory.url
packageDirectory: packageDirectory.asURL
)
try result.checkNonZeroExit()
let output = try result.utf8Output()

View File

@ -58,10 +58,6 @@ func withFixture(_ name: String, _ body: (AbsolutePath) async throws -> Void) as
}
extension AbsolutePath {
var url: URL {
URL(fileURLWithPath: pathString)
}
var exists: Bool {
FileManager.default.fileExists(atPath: pathString)
}