use super::*;
#[test]
fn a_recorded_path_renders_portably_on_every_platform() {
assert_eq!(
portable_path(r"control\object\button\button.rs"),
"control/object/button/button.rs"
);
assert_eq!(
portable_path("control/object/button/button.rs"),
"control/object/button/button.rs"
);
assert_eq!(
portable_path(r"C:\proj\src\control\control.rs"),
"C:/proj/src/control/control.rs"
);
assert_eq!(portable_path(""), "");
}
#[test]
fn a_query_with_slashes_matches_a_backslashed_source() {
assert!(source_file_matches(
r"toolchain\tests\runtime_external_compact_face.rs",
"toolchain/tests/runtime_external"
));
assert!(source_file_matches(
r"toolchain\tests\runtime_external_compact_face.rs",
"external_compact"
));
assert!(source_file_matches(
r"Run_Method\Tests\External.rs",
"tests/external"
));
assert!(!source_file_matches(
r"run_method\tests\external.rs",
"toolchain/src/studio/tests"
));
assert!(source_file_matches(
"toolchain/tests/runtime_external_compact_face.rs",
"tests/runtime_external"
));
}