Skip to content

Commit 37be6af

Browse files
committed
test(opencode): normalize glob reference paths on windows
1 parent c2565db commit 37be6af

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/opencode/test/tool/glob.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { RepositoryCache } from "@/reference/repository-cache"
1717
import { Config } from "@/config/config"
1818
import { RuntimeFlags } from "@/effect/runtime-flags"
1919
import { Git } from "@/git"
20+
import { Filesystem } from "@/util/filesystem"
2021
import { Permission } from "../../src/permission"
2122
import type * as Tool from "../../src/tool/tool"
2223

@@ -40,6 +41,7 @@ const toolLayer = (flags: Partial<RuntimeFlags.Info> = {}) =>
4041

4142
const it = testEffect(toolLayer())
4243
const references = testEffect(toolLayer({ experimentalReferences: true }))
44+
const full = (p: string) => (process.platform === "win32" ? Filesystem.normalizePath(p) : p)
4345

4446
const ctx = {
4547
sessionID: SessionID.make("ses_test"),
@@ -172,7 +174,7 @@ describe("tool.glob", () => {
172174
)
173175

174176
expect(result.metadata.count).toBe(1)
175-
expect(result.output).toContain(path.join(cache, "src", "index.ts"))
177+
expect(full(result.output)).toContain(full(path.join(cache, "src", "index.ts")))
176178
expect(items.find((item) => item.permission === "external_directory")).toBeUndefined()
177179
}),
178180
{

0 commit comments

Comments
 (0)