From 53ef6d75b96994779b88986fc90c487dd8b0d2d6 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Nov 2026 17:49:41 +0000 Subject: [PATCH] test: remove four file URL tests that stronger tests cover `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 Claude-Session: https://claude.ai/code/session_01PxVsmvB9xfZKfVnUonY8kf --- src/lib.rs | 7 ------- src/windows_file_url.rs | 18 ------------------ 2 files changed, 25 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 9823011a..9a48b51b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4621,13 +4621,6 @@ mod tests { assert!(!parses_with_decorator_as("export @dec class A {}", SourceType::d_ts())); } - #[cfg(not(windows))] - #[test] - fn non_windows_behavior_is_unchanged() { - assert_eq!(file_url_to_path("file:///a/b.ts"), Some(PathBuf::from("/a/b.ts"))); - assert_eq!(file_url_to_path("file:///a%20b.ts"), Some(PathBuf::from("/a b.ts"))); - } - // Expected strings below are what Node's `pathToFileURL` writes for the // same path (issue #837). #[test] diff --git a/src/windows_file_url.rs b/src/windows_file_url.rs index 1fefb422..bdf9c9b5 100644 --- a/src/windows_file_url.rs +++ b/src/windows_file_url.rs @@ -639,16 +639,6 @@ mod tests { // `file:///C:/…` form. The module is compiled into test builds on every // platform, so these run wherever `cargo test` does. - #[test] - fn windows_drive_url_parses() { - assert_eq!(url_to_path("file:///C:/a/b.ts"), Some(PathBuf::from("C:/a/b.ts"))); - } - - #[test] - fn windows_drive_path_generates() { - assert_eq!(path_to_url("C:\\a\\b.ts"), "file:///C:/a/b.ts"); - } - // Issue #837: the drive form is percent-encoded like `pathToFileURL` // writes it, while the drive letter keeps its case and its `:`. #[test] @@ -668,14 +658,6 @@ mod tests { } } - #[test] - fn windows_unc_url_parses_to_unc_path() { - assert_eq!( - url_to_path("file://server/share/dir/module.ts"), - Some(PathBuf::from("\\\\server\\share\\dir\\module.ts")) - ); - } - #[test] fn windows_unc_url_without_path_parses_to_server_root() { assert_eq!(url_to_path("file://server"), Some(PathBuf::from("\\\\server\\")));