mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
c72676a84d
commit
7ac252d428
1 changed files with 4 additions and 2 deletions
|
|
@ -138,6 +138,8 @@ impl Loc {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
use std::path::MAIN_SEPARATOR;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
@ -184,12 +186,12 @@ mod tests {
|
||||||
assert_eq!(loc.base().as_os_str(), OsStr::new("/root/"));
|
assert_eq!(loc.base().as_os_str(), OsStr::new("/root/"));
|
||||||
|
|
||||||
loc.set_name("bar.txt");
|
loc.set_name("bar.txt");
|
||||||
assert_eq!(loc.urn().as_os_str(), OsStr::new("code/bar.txt"));
|
assert_eq!(loc.urn().as_os_str(), OsString::from(format!("code{MAIN_SEPARATOR}bar.txt")));
|
||||||
assert_eq!(loc.name(), OsStr::new("bar.txt"));
|
assert_eq!(loc.name(), OsStr::new("bar.txt"));
|
||||||
assert_eq!(loc.base().as_os_str(), OsStr::new("/root/"));
|
assert_eq!(loc.base().as_os_str(), OsStr::new("/root/"));
|
||||||
|
|
||||||
loc.set_name("baz");
|
loc.set_name("baz");
|
||||||
assert_eq!(loc.urn().as_os_str(), OsStr::new("code/baz"));
|
assert_eq!(loc.urn().as_os_str(), OsString::from(format!("code{MAIN_SEPARATOR}baz")));
|
||||||
assert_eq!(loc.name(), OsStr::new("baz"));
|
assert_eq!(loc.name(), OsStr::new("baz"));
|
||||||
assert_eq!(loc.base().as_os_str(), OsStr::new("/root/"));
|
assert_eq!(loc.base().as_os_str(), OsStr::new("/root/"));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue