Test that example justfiles successfully parse (#643)

Parse all entries in `examples` as justfiles, to make sure that example
justfiles parse successfully.
This commit is contained in:
Casey Rodarmor 2020-06-09 22:57:16 -07:00 committed by GitHub
parent 97aa9251ce
commit d7a51e72f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

23
tests/examples.rs Normal file
View File

@ -0,0 +1,23 @@
use std::{fs, process::Command};
use executable_path::executable_path;
use test_utilities::assert_success;
#[test]
fn examples() {
for result in fs::read_dir("examples").unwrap() {
let entry = result.unwrap();
let path = entry.path();
println!("Parsing `{}`…", path.display());
let output = Command::new(executable_path("just"))
.arg("--justfile")
.arg(&path)
.arg("--dump")
.output()
.unwrap();
assert_success(&output);
}
}