Skip to content

Commit fa2ff9b

Browse files
committed
test: normalize plugin source paths
Signed-off-by: Will Killian <wkillian@nvidia.com>
1 parent 038ba76 commit fa2ff9b

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

crates/cli/tests/coverage/config_tests.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,21 @@ fn effective_plugin_toml_sources_reports_empty_and_sorted_contributors() {
9292
std::fs::write(&project_plugins, "version = 1\ncomponents = []\n").unwrap();
9393
std::fs::write(&user_plugins, "version = 1\ncomponents = []\n").unwrap();
9494

95-
let mut expected = vec![project_plugins.canonicalize().unwrap(), user_plugins];
95+
let sources = effective_plugin_toml_sources().unwrap();
96+
assert!(sources.is_sorted());
97+
assert!(sources.windows(2).all(|paths| paths[0] != paths[1]));
98+
99+
let mut actual = sources
100+
.iter()
101+
.map(|path| path.canonicalize().unwrap())
102+
.collect::<Vec<_>>();
103+
actual.sort();
104+
let mut expected = [project_plugins, user_plugins]
105+
.iter()
106+
.map(|path| path.canonicalize().unwrap())
107+
.collect::<Vec<_>>();
96108
expected.sort();
97-
assert_eq!(effective_plugin_toml_sources().unwrap(), expected);
109+
assert_eq!(actual, expected);
98110
}
99111

100112
fn isolated_config_path(temp: &tempfile::TempDir) -> std::path::PathBuf {

0 commit comments

Comments
 (0)