Skip to content

Commit 76ca132

Browse files
committed
Use path variant for executables with full paths in tests
1 parent babff74 commit 76ca132

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Tests/SubprocessTests/SubprocessTests+Darwin.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ struct SubprocessDarwinTests {
4141
// Check the proces ID (pid), pross group ID (pgid), and
4242
// controling terminal's process group ID (tpgid)
4343
let psResult = try await Subprocess.run(
44-
.name("/bin/bash"),
44+
.path("/bin/bash"),
4545
arguments: ["-c", "ps -o pid,pgid,tpgid -p $$"],
4646
platformOptions: platformOptions,
4747
output: .string

Tests/SubprocessTests/SubprocessTests+Linux.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct SubprocessLinuxTests {
3333
setgid(4321)
3434
}
3535
let idResult = try await Subprocess.run(
36-
.name("/usr/bin/id"),
36+
.path("/usr/bin/id"),
3737
arguments: ["-g"],
3838
platformOptions: platformOptions,
3939
output: .string

Tests/SubprocessTests/SubprocessTests+Unix.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ extension SubprocessUnixTests {
658658
contentsOf: URL(filePath: theMysteriousIsland.string)
659659
)
660660
let catResult = try await Subprocess.run(
661-
.name("/bin/bash"),
661+
.path("/bin/bash"),
662662
arguments: ["-c", "cat \(theMysteriousIsland.string) 1>&2"],
663663
error: .data(limit: 2048 * 1024)
664664
)
@@ -756,7 +756,7 @@ extension SubprocessUnixTests {
756756
// Sets the process group ID to 0, which creates a new session
757757
platformOptions.processGroupID = 0
758758
let psResult = try await Subprocess.run(
759-
.name("/bin/bash"),
759+
.path("/bin/bash"),
760760
arguments: ["-c", "ps -o pid,pgid -p $$"],
761761
platformOptions: platformOptions,
762762
output: .string
@@ -782,7 +782,7 @@ extension SubprocessUnixTests {
782782
// Check the proces ID (pid), pross group ID (pgid), and
783783
// controling terminal's process group ID (tpgid)
784784
let psResult = try await Subprocess.run(
785-
.name("/bin/bash"),
785+
.path("/bin/bash"),
786786
arguments: ["-c", "ps -o pid,pgid,tpgid -p $$"],
787787
platformOptions: platformOptions,
788788
output: .string
@@ -795,7 +795,7 @@ extension SubprocessUnixTests {
795795
return
796796
}
797797
let result = try await Subprocess.run(
798-
.name("/bin/bash"),
798+
.path("/bin/bash"),
799799
arguments: [
800800
"-c",
801801
"""
@@ -916,7 +916,7 @@ extension SubprocessUnixTests {
916916
isEqualTo expected: gid_t
917917
) async throws {
918918
let idResult = try await Subprocess.run(
919-
.name("/usr/bin/id"),
919+
.path("/usr/bin/id"),
920920
arguments: [argument],
921921
platformOptions: platformOptions,
922922
output: .string

0 commit comments

Comments
 (0)