..
2023-01-04 06:31:56 +00:00
2023-01-04 06:31:56 +00:00
2022-12-15 16:53:21 -08:00
2022-06-25 09:39:06 +00:00
2021-03-28 22:38:07 -07:00
2023-01-13 10:30:38 -08:00
2022-12-30 20:36:08 +00:00
2023-01-13 03:25:28 +00:00
2023-01-04 06:31:56 +00:00
2022-11-02 23:37:35 -07:00
2023-01-04 06:31:56 +00:00
2023-01-04 06:31:56 +00:00
2022-12-15 16:53:21 -08:00
2023-01-04 06:31:56 +00:00
2022-12-15 16:53:21 -08:00
2023-01-04 06:31:56 +00:00
2022-12-30 20:36:08 +00:00
2022-11-23 00:36:23 +00:00

use super::*;

#[test]
fn readme() {
  let mut justfiles = vec![];
  let mut current = None;

  for line in fs::read_to_string("README.md").unwrap().lines() {
    if let Some(mut justfile) = current {
      if line == "```" {
        justfiles.push(justfile);
        current = None;
      } else {
        justfile += line;
        justfile += "\n";
        current = Some(justfile);
      }
    } else if line == "```just" {
      current = Some(String::new());
    }
  }

  for justfile in justfiles {
    let tmp = tempdir();

    let path = tmp.path().join("justfile");

    fs::write(path, justfile).unwrap();

    let output = Command::new(executable_path("just"))
      .current_dir(tmp.path())
      .arg("--dump")
      .output()
      .unwrap();

    assert_success(&output);
  }
}