byterover-cli icon indicating copy to clipboard operation
byterover-cli copied to clipboard

[BUG] Test failure: Relative File Path Handling on Windows

Open albahrani opened this issue 1 year ago • 0 comments

Bug Description

The systemPrompt test should handle relative file paths fails on Windows environments.

A test for handling relative file paths fails on Windows due to differences in path separators (/ vs ). The test expects Unix-style separators, but Windows uses backslashes.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Run the test suite on Windows.
  2. Observe the failure in the relative file path handling test.

Expected Behavior

The test should pass on all platforms, correctly handling platform-specific path separators.

Actual Behavior

The test fails on Windows because the expected path separator does not match the actual output.

Screenshots

N/A

Environment Information

  • OS: Windows
  • Browser: N/A
  • Version: Cipher 0.3.0
  • Node.js version: v24.5.0

Logs and Error Messages

Please provide any relevant logs, error messages, or console output:

FAIL  src/core/brain/systemPrompt/__test__/config-manager.test.ts > SystemPromptConfigManager > loadFromFile > should handle relative file paths
AssertionError: expected 'T:\Development\cipher\temp-test-configs\' to contain 'relative/path.txt'

Expected: "relative/path.txt"
Received: "T:\Development\cipher\temp-test-configs\relative\path.txt"

Additional Context

This issue is platform-specific and does not occur on Unix-like systems.

Possible Solution

  • Update the test to use path.sep or similar platform-aware logic for path comparisons.
  • Alternatively, normalize paths in the test or code to use a consistent separator before comparison.

Checklist

  • [x] I have searched for similar issues before creating this one
  • [x] I have provided all the requested information above
  • [x] I have tested this on the latest version

albahrani avatar Aug 31 '25 17:08 albahrani