Fixed bug that only tested one file

This commit is contained in:
David Harris 2017-02-25 11:24:24 -06:00
parent 117dcf9995
commit 0a3fe6675f

View file

@ -4,12 +4,17 @@ use std::fs;
fn main() {
let paths = fs::read_dir("./pages/").unwrap();
let mut vec = Vec::new();
// Convert paths to strings and add to vec
for path in paths {
let p = path.unwrap().path();
let s = p.to_str().unwrap();
if s.contains(".md") {
skeptic::generate_doc_tests(&[s])
vec.push(s.to_string());
}
}
// Convert Vec<String> to Vec<str>
let vec: Vec<_> = vec.iter().map(|s|&s[..]).collect();
skeptic::generate_doc_tests(&vec);
}