diff --git a/src/lib.rs b/src/lib.rs index 001317f..404793c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,11 +24,24 @@ mod tests { let paths = fs::read_dir(&path::Path::new("./test_images")).unwrap(); let mut num_paths = 0; for path in paths { - num_paths += 1; + let orig_path = path.unwrap().path(); + let ext = path::Path::new(&orig_path).extension(); + match ext { + Some(_) => { + if ext.unwrap() == "jpg" { + println!("Is a image {}: {:?}", num_paths, orig_path) ; + num_paths += 1; + } + }, + _ => { + println!("Not an image: {:?}", orig_path) ; + continue + } + } //println!("Name: {}", path.unwrap().path().display()) } - // Currently 13 files in the test imaages directory - assert!(num_paths >= 13); + // Currently 12 images in the test imaages directory + assert!(num_paths == 12); } } diff --git a/src/main.rs b/src/main.rs index aa8211b..35db5b7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,10 +3,10 @@ // Licensed under the MIT license. // This file may not be copied, modified, or distributed except according to those terms. -extern crate perceptual_image_hashing; +extern crate pihash; fn main() { let mut string = String::new(); - string = perceptual_image_hashing::hello(string); + string = pihash::hello(string); println!("{}",string); }