Repository navigation
test: remove four file URL tests that stronger tests cover - #904
Merged
Merged
Conversation
`windows_drive_url_parses`, `windows_drive_path_generates`, `windows_unc_url_parses_to_unc_path` and `non_windows_behavior_is_unchanged` were the first, one-line file URL tests from #760. Each now checks a strict subset of what a later test in the same module checks, and every regression they catch also fails one of those tests: - `windows_drive_url_parses`: `windows_scheme_is_case_insensitive`, `windows_query_and_fragment_are_not_part_of_the_path`, `windows_dot_segments_are_normalized`, `windows_drive_path_is_percent_encoded` - `windows_drive_path_generates`: `windows_drive_path_is_percent_encoded`, `windows_verbatim_prefix_is_ignored` - `windows_unc_url_parses_to_unc_path`: `windows_unc_url_decodes_escapes`, `windows_mapping_interactions`, `windows_dot_segments_are_normalized` - `non_windows_behavior_is_unchanged`: `posix_file_url_round_trips`, `watch_report_urls_are_encoded_and_absolute_only` Only `#[cfg(test)]` modules change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PxVsmvB9xfZKfVnUonY8kf
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Brooklyn · project thread
Before: four one-line file URL tests from #760 (
windows_drive_url_parses,windows_drive_path_generates,windows_unc_url_parses_to_unc_path,non_windows_behavior_is_unchanged) each checked a strict subset of what another test in the same module checks. No regression fails one of them without also failing a stronger test.After: those four tests are gone. Only
#[cfg(test)]modules insrc/lib.rsandsrc/windows_file_url.rschange.How: each removal was defended by mutating the product code with the most realistic regression it could catch, running
cargo test --all-features --lib, and reverting.Note: the CI job "Test WASI target" (step "Test bindings") already fails on
main, sinceffa98c1(#901, 2026-11-01). It will fail here too; this PR does not touch it.Totals
<0.000s).Removals
windows_drive_url_parses(file:///C:/a/b.ts→C:/a/b.ts). Keeping the leading/in the drive form also failswindows_scheme_is_case_insensitive,windows_query_and_fragment_are_not_part_of_the_path,windows_dot_segments_are_normalizedandwindows_drive_path_is_percent_encoded.windows_drive_path_generates(C:\a\b.ts→file:///C:/a/b.ts). Not converting backslashes also failswindows_drive_path_is_percent_encodedandwindows_verbatim_prefix_is_ignored; converting only the first one also failswindows_drive_path_is_percent_encoded, whosec:\a:b\x.tsrow covers the same path.windows_unc_url_parses_to_unc_path(a three-segment UNC URL). Converting only the first separator, the one thing its depth adds, also failswindows_unc_url_decodes_escapes,windows_mapping_interactionsandwindows_dot_segments_are_normalized.non_windows_behavior_is_unchanged(POSIXfile_url_to_pathfor a plain and a%20path). It was added with the fix for Windows UNC file URLs are not resolved or generated correctly #744, Windows URL rules leaking into POSIX paths. That bug's regression (POSIXfile_url_to_pathcallingwindows_file_url::url_to_path) also failsposix_file_url_round_trips,watch_report_urls_are_encoded_and_absolute_onlyanddiagnostics_render_location_and_code_frame. Dropping'0'fromhex_digit, skipping decoding, and breaking the no-%fast path each also fail other tests (5, 3 andposix_file_url_round_trips).Kept after defense
windows_escaped_unc_path_round_trips: its decode-back half is the only UNC-form check of%25.Case counts
src/windows_file_url.rstestssrc/lib.rstests0 failures before and after.
What ran and what did not
ffa98c1: all three JS suites against a debug addon, andcargo test --all-featureswith--report-time.cargo test --all-features --lib(53 passed),cargo fmt --check,cargo clippy --all-targets --all-features -- -D warningsandgit diff --check, all clean.loader_contexttests under--no-default-features, Windows, the WASI build and the bench. The JS suites were not re-run after the change, which touches only#[cfg(test)]code.Open pull requests: neither open PR (#903, #894) touches a test file.
Ages: all four tests were added on 2026-09-14 in #760 and are unchanged since. None is in a permission or security suite.
To revert:
git revert 53ef6d7.Generated by Claude Code