Skip to content

Commit e7b069b

Browse files
committed
test: normalize windows path assertions
1 parent f4f0b16 commit e7b069b

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

src/infra/exec-command-resolution.test.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,16 @@ describe("exec-command-resolution", () => {
192192

193193
it("resolves allowlist candidate paths from unresolved raw executables", () => {
194194
expect(
195-
resolveAllowlistCandidatePath(
196-
{
197-
rawExecutable: "~/bin/tool",
198-
executableName: "tool",
199-
},
200-
"/tmp",
195+
path.normalize(
196+
resolveAllowlistCandidatePath(
197+
{
198+
rawExecutable: "~/bin/tool",
199+
executableName: "tool",
200+
},
201+
"/tmp",
202+
) ?? "",
201203
),
202-
).toContain("/bin/tool");
204+
).toContain(path.normalize(path.join("bin", "tool")));
203205

204206
expect(
205207
resolveAllowlistCandidatePath(

src/infra/home-dir.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ describe("expandHomePrefix", () => {
109109
name: "expands exact ~ using explicit home",
110110
input: "~",
111111
opts: { home: " /srv/openclaw-home " },
112-
expected: "/srv/openclaw-home",
112+
expected: path.resolve("/srv/openclaw-home"),
113113
},
114114
{
115115
name: "expands ~\\\\ using resolved env home",

0 commit comments

Comments
 (0)