Skip to content

Commit a8a349d

Browse files
authored
Adding a small test for normal_path.rs (#288)
- Adding a small test for normal_path.rs
1 parent 108f5a5 commit a8a349d

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

src/normal_path.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,22 @@ impl ValueParserFactory for NormalPath {
183183
Self::Parser::default()
184184
}
185185
}
186+
187+
#[cfg(test)]
188+
mod tests {
189+
use std::env;
190+
191+
use super::*;
192+
193+
#[test]
194+
fn test_into_absolute() {
195+
let dir = env::temp_dir();
196+
let path_buf = Utf8PathBuf::from_path_buf(dir.clone()).unwrap();
197+
let test_path = NormalPath {
198+
normal: path_buf,
199+
relative: None,
200+
};
201+
202+
assert_eq!(test_path.into_absolute().as_os_str(), dir.as_os_str());
203+
}
204+
}

0 commit comments

Comments
 (0)