1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00

fix glob pattern

This commit is contained in:
dark64 2021-08-05 16:25:54 +02:00
parent b9f16d30eb
commit fee8535bce

View file

@ -124,13 +124,18 @@ mod tests {
builder
.spawn(|| {
for p in glob("./examples/**/*.zok").expect("Failed to read glob pattern") {
for p in glob("./examples/**/!(*.sh)").expect("Failed to read glob pattern") {
let path = match p {
Ok(x) => x,
Err(why) => panic!("Error: {:?}", why),
};
if !path.is_file() {
continue;
}
println!("Testing {:?}", path);
assert_eq!(path.extension().expect("extension expected"), "zok");
let should_error = path.to_str().unwrap().contains("compile_errors");
@ -165,7 +170,9 @@ mod tests {
Ok(x) => x,
Err(why) => panic!("Error: {:?}", why),
};
println!("Testing {:?}", path);
assert_eq!(path.extension().expect("extension expected"), "zok");
let file = File::open(path.clone()).unwrap();
@ -190,12 +197,14 @@ mod tests {
#[test]
fn execute_examples_err() {
//these examples should compile but not run
for p in glob("./examples/runtime_errors/*.zok").expect("Failed to read glob pattern") {
for p in glob("./examples/runtime_errors/*").expect("Failed to read glob pattern") {
let path = match p {
Ok(x) => x,
Err(why) => panic!("Error: {:?}", why),
};
println!("Testing {:?}", path);
assert_eq!(path.extension().expect("extension expected"), "zok");
let file = File::open(path.clone()).unwrap();