Skip to content

Commit

Permalink
Add two tests for FileFpec
Browse files Browse the repository at this point in the history
  • Loading branch information
emabee committed Sep 24, 2024
1 parent cd2e2d3 commit 673eb65
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/parameters/file_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,4 +493,24 @@ mod test {
.as_pathbuf(None);
assert_eq!(path.file_name().unwrap().to_str().unwrap(), "1234.txt");
}

#[test]
fn test_empty_base_name() {
let path = FileSpec::default()
.suppress_basename()
.suppress_timestamp()
.o_discriminant(Option::<String>::None)
.as_pathbuf(None);
assert_eq!(path.file_name().unwrap(), ".log");
}

#[test]
fn test_empty_name() {
let path = FileSpec::default()
.suppress_basename()
.suppress_timestamp()
.o_suffix(Option::<String>::None)
.as_pathbuf(None);
assert!(path.file_name().is_none());
}
}

0 comments on commit 673eb65

Please sign in to comment.