zip-rs-wasm/tests/zip_extended_timestamp.rs
2024-06-03 17:47:52 -07:00

19 lines
629 B
Rust

use std::io;
use zip::ZipArchive;
#[test]
fn test_extended_timestamp() {
let mut v = Vec::new();
v.extend_from_slice(include_bytes!("../tests/data/extended_timestamp.zip"));
let mut archive = ZipArchive::new(io::Cursor::new(v)).expect("couldn't open test zip file");
for field in archive.by_name("test.txt").unwrap().extra_data_fields() {
match field {
zip::ExtraField::ExtendedTimestamp(ts) => {
assert!(ts.ac_time().is_none());
assert!(ts.cr_time().is_none());
assert_eq!(ts.mod_time().unwrap(), 1714635025);
}
}
}
}