just/tests
2023-11-22 04:17:38 +00:00
..
completions Inline setup and cleanup functions in completion script test (#1352) 2022-09-23 20:54:18 -07:00
allow_duplicate_recipes.rs
assert_stdout.rs Add invocation_directory_native() (#1507) 2023-01-13 19:03:14 +00:00
assert_success.rs
assignment.rs Improve error message if if is missing the else (#1252) 2022-06-30 10:34:11 +00:00
attributes.rs
byte_order_mark.rs
changelog.rs
choose.rs Misc fixes (#1700) 2023-10-17 03:07:09 +00:00
command.rs
completions.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
conditional.rs
confirm.rs
delimiters.rs
dotenv.rs
edit.rs
equals.rs
error_messages.rs
evaluate.rs Add / operator (#1237) 2022-06-25 09:39:06 +00:00
examples.rs
export.rs
fallback.rs
fmt.rs
functions.rs
ignore_comments.rs
includes.rs
init.rs
interrupts.rs Downgrade to TLS 1.2 in install script (#1536) 2023-01-27 02:49:03 +00:00
invocation_directory.rs Downgrade to TLS 1.2 in install script (#1536) 2023-01-27 02:49:03 +00:00
json.rs
lib.rs
line_prefixes.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
misc.rs
multibyte_char.rs
newline_escape.rs
no_cd.rs
no_exit_message.rs
os_attributes.rs Add OS Configuration Attributes (#1387) 2022-10-31 00:52:03 -07:00
parser.rs Allow comments on same line as settings (#1339) 2022-09-10 15:19:49 -07:00
positional_arguments.rs Pass evaluated arguments as positional arguments (#810) 2021-05-02 10:25:43 +00:00
private.rs
quiet.rs
quote.rs Stabilize fallback (#1471) 2023-01-04 06:31:56 +00:00
readme.rs Eliminate lazy_static (#1442) 2022-12-15 16:53:21 -08:00
recursion_limit.rs
regexes.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
run.rs Stabilize fallback (#1471) 2023-01-04 06:31:56 +00:00
search_arguments.rs Test passing dot as argument between justfiles (#1530) 2023-01-25 05:33:43 +00:00
search.rs Misc fixes (#1700) 2023-10-17 03:07:09 +00:00
shadowing_parameters.rs
shebang.rs
shell.rs
show.rs
slash_operator.rs
string.rs
subsequents.rs
tempdir.rs
test.rs Add semver_matches function (#1713) 2023-10-27 20:07:46 +00:00
undefined_variables.rs
unstable.rs
windows_shell.rs
working_directory.rs

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);
  }
}