mirror of
https://github.com/affaan-m/ECC.git
synced 2026-09-10 03:37:54 +02:00
fix(opencode): normalize tool paths across platforms (#2459)
Normalize backslash paths for OpenCode formatting and add branch coverage for GitHub coordination behavior.
This commit is contained in:
@@ -108,6 +108,24 @@ async function main() {
|
||||
),
|
||||
])
|
||||
|
||||
tests.push([
|
||||
"format-code: normalizes Windows backslash paths to forward slashes",
|
||||
async () => withTempProject(
|
||||
["tsconfig.json", "src/index.ts"],
|
||||
async (projectDir) => {
|
||||
const context = createMockContext(projectDir)
|
||||
const result = await tools.formatcode.execute(
|
||||
{ filePath: "src\\index.ts" },
|
||||
context
|
||||
)
|
||||
const parsed = JSON.parse(result)
|
||||
assert.strictEqual(parsed.success, true)
|
||||
assert.ok(parsed.command.includes("src/index.ts"), `expected forward slashes in command: ${parsed.command}`)
|
||||
assert.ok(!parsed.command.includes("src\\index.ts"), `unexpected backslashes in command: ${parsed.command}`)
|
||||
}
|
||||
),
|
||||
])
|
||||
|
||||
tests.push([
|
||||
"format-code: detects Python formatter",
|
||||
async () => withTempProject(
|
||||
|
||||
Reference in New Issue
Block a user