-
Notifications
You must be signed in to change notification settings - Fork 274
Description
Describe the bug
FileUriUtilTest fails on Windows when running from a drive other than C:.
This happens because normalizeFileUri() hardcodes the drive letter as "C" instead of detecting the current drive, causing URI mismatches in the tests.
To reproduce
- On Windows, place the project on a non-
C:drive (e.g.,F:). - Open the project in a JetBrains IDE.
- Run
FileUriUtilTest, TextDocumentServiceHandlerTest - Tests that compare URIs (e.g.,
test basic unix path) will fail.
Expected behavior
On Windows, the drive letter in the URI should be based on the actual drive the project is running from.
Tests should pass regardless of whether the project is on C:, D:, F:, etc.
Screenshots
Your Environment
- OS: Windows 11
- JetBrains product: IntelliJ IDEA Ultimate
- JetBrains product version: IntelliJ IDEA 2025.1.3 (Ultimate Edition)
- AWS Toolkit version: latest
mainbranch / 3.90-SNAPSHOT / a8dadbb - SAM CLI version: N/A
- JVM/Python version: corretto-21
Additional context
The normalizeFileUri() function should not hardcode the drive letter to C.
Instead, it should detect the current drive (e.g., via Paths.get("").toAbsolutePath().root or System.getenv("SystemDrive")) to ensure tests behave consistently across different drives.