Skip to content

Commit

Permalink
Adding a small test for normal_path.rs (#288)
Browse files Browse the repository at this point in the history
- Adding a small test for normal_path.rs
  • Loading branch information
atruslow authored Jun 5, 2024
1 parent 108f5a5 commit a8a349d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/normal_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,22 @@ impl ValueParserFactory for NormalPath {
Self::Parser::default()
}
}

#[cfg(test)]
mod tests {
use std::env;

use super::*;

#[test]
fn test_into_absolute() {
let dir = env::temp_dir();
let path_buf = Utf8PathBuf::from_path_buf(dir.clone()).unwrap();
let test_path = NormalPath {
normal: path_buf,
relative: None,
};

assert_eq!(test_path.into_absolute().as_os_str(), dir.as_os_str());
}
}

0 comments on commit a8a349d

Please sign in to comment.