We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fada845 commit 3adb3e0Copy full SHA for 3adb3e0
src/fileio.rs
@@ -25,3 +25,19 @@ fn file_to_hyphen_test() {
25
let result = file_to_hyphen("2022.04.06.name with space.mp4");
26
assert_eq!(result, "2022-04-06-name-with-space-mp4");
27
}
28
+
29
+#[test]
30
+fn write_metadata_test() {
31
+ let output_metadata = OutputMetadata {
32
+ title: "temp".to_string(),
33
+ ..Default::default()
34
+ };
35
36
+ let _result = write_metadata(&output_metadata);
37
38
+ let file = File::open("temp/temp.json").expect("error opening file");
39
+ let reader = std::io::BufReader::new(file);
40
+ let metadata: OutputMetadata = serde_json::from_reader(reader).expect("unable to read json");
41
42
+ assert_eq!(metadata.title, "temp")
43
+}
0 commit comments