mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-10 02:24:35 +08:00
- Created a new JSON file with benchmark results from the run on 2026-02-09. - Added tests for the StandaloneLspManager to verify path normalization on Windows, including handling of percent-encoded URIs and ensuring plain Windows paths remain unchanged.
49 lines
1.5 KiB
Python
49 lines
1.5 KiB
Python
"""Tests for StandaloneLspManager path normalization (Windows URI handling)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import platform
|
|
|
|
from codexlens.lsp.standalone_manager import StandaloneLspManager
|
|
|
|
|
|
def test_normalize_file_uri_percent_encoded_windows_drive() -> None:
|
|
if platform.system() != "Windows":
|
|
return
|
|
|
|
manager = StandaloneLspManager(workspace_root="D:/Claude_dms3/codex-lens")
|
|
|
|
raw = "file:///d%3A/Claude_dms3/codex-lens/src/codexlens/lsp/standalone_manager.py"
|
|
normalized = manager._normalize_file_path(raw)
|
|
|
|
assert normalized.lower().startswith("d:/")
|
|
assert "%3a" not in normalized.lower()
|
|
assert "d%3a" not in normalized.lower()
|
|
assert "/d%3a" not in normalized.lower()
|
|
|
|
|
|
def test_normalize_uri_path_percent_encoded_windows_drive() -> None:
|
|
if platform.system() != "Windows":
|
|
return
|
|
|
|
manager = StandaloneLspManager(workspace_root="D:/Claude_dms3/codex-lens")
|
|
|
|
raw = "/d%3A/Claude_dms3/codex-lens/src/codexlens/lsp/standalone_manager.py"
|
|
normalized = manager._normalize_file_path(raw)
|
|
|
|
assert normalized.lower().startswith("d:/")
|
|
assert "%3a" not in normalized.lower()
|
|
|
|
|
|
def test_normalize_plain_windows_path_is_unchanged() -> None:
|
|
if platform.system() != "Windows":
|
|
return
|
|
|
|
manager = StandaloneLspManager(workspace_root="D:/Claude_dms3/codex-lens")
|
|
|
|
raw = r"D:\Claude_dms3\codex-lens\src\codexlens\lsp\standalone_manager.py"
|
|
normalized = manager._normalize_file_path(raw)
|
|
|
|
assert normalized == raw
|
|
|