..
2024-05-15 01:55:32 +00:00
2024-05-14 23:30:19 +00:00
2023-01-04 06:31:56 +00:00
2024-05-18 23:12:11 +00:00
2023-10-16 20:18:25 -07:00
2022-06-25 09:39:06 +00:00
2021-03-28 22:38:07 -07:00
2024-05-14 20:29:40 -07:00
2024-05-19 09:29:13 +00:00
2024-05-15 07:28:50 +00:00
2022-11-02 23:37:35 -07:00
2023-01-04 06:31:56 +00:00
2024-01-12 20:38:23 +00:00
2023-01-04 06:31:56 +00:00
2024-05-14 20:07:41 -07:00
2023-01-04 06:31:56 +00:00
2023-10-17 03:07:09 +00:00
2023-10-17 03:07:09 +00:00
2024-05-29 09:28:45 +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::new();
  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);
  }
}