From ca4a39d425a47d4d156313eef2dd3558d42bb4be Mon Sep 17 00:00:00 2001 From: Roo Code Date: Sun, 16 Nov 2025 09:55:55 +0000 Subject: [PATCH] fix: make path corruption tests platform-independent --- src/core/tools/__tests__/pathCorruption.spec.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/core/tools/__tests__/pathCorruption.spec.ts b/src/core/tools/__tests__/pathCorruption.spec.ts index b48a29313a..f6c0d2071a 100644 --- a/src/core/tools/__tests__/pathCorruption.spec.ts +++ b/src/core/tools/__tests__/pathCorruption.spec.ts @@ -4,6 +4,7 @@ import { GenerateImageTool } from "../GenerateImageTool" import { Task } from "../../task/Task" import type { ToolCallbacks } from "../BaseTool" import { EXPERIMENT_IDS } from "../../../shared/experiments" +import { getReadablePath } from "../../../utils/path" describe("File path corruption fix", () => { let mockTask: Task @@ -170,7 +171,9 @@ describe("File path corruption fix", () => { const mockAskApproval = mockCallbacks.askApproval as any const approvalCall = mockAskApproval.mock.calls[0] const approvalMessage = JSON.parse(approvalCall[1]) - expect(approvalMessage.path).toBe(testPath) + // Use getReadablePath to get the expected value (platform-independent) + const expectedPath = getReadablePath(mockTask.cwd, testPath) + expect(approvalMessage.path).toBe(expectedPath) }) it("should handle paths containing 'str' correctly", async () => { @@ -187,7 +190,9 @@ describe("File path corruption fix", () => { const mockAskApproval = mockCallbacks.askApproval as any const approvalCall = mockAskApproval.mock.calls[0] const approvalMessage = JSON.parse(approvalCall[1]) - expect(approvalMessage.path).toBe(testPath) + // Use getReadablePath to get the expected value (platform-independent) + const expectedPath = getReadablePath(mockTask.cwd, testPath) + expect(approvalMessage.path).toBe(expectedPath) }) })