try hash test

This commit is contained in:
Aravinth Manivannan 2021-04-08 20:14:53 +05:30
parent e09a6ad0cb
commit 9abdf468b1
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88

View file

@ -214,4 +214,33 @@ mod tests {
assert_eq!(src.exists(), dest.exists());
}
}
#[test]
fn try_hash_works() {
let types = vec![
mime::IMAGE_PNG,
mime::IMAGE_SVG,
mime::IMAGE_JPEG,
mime::IMAGE_GIF,
];
let config = BusterBuilder::default()
.source("./dist")
.result("/tmp/prod")
.mime_types(types)
.copy(true)
.follow_links(true)
.build()
.unwrap();
config.init().unwrap();
let mut map = config.hash().unwrap();
for (k, v) in map.drain() {
let src = Path::new(&k);
let dest = Path::new(&v);
assert_eq!(src.exists(), dest.exists());
}
}
}