just/tests
2023-12-31 22:03:49 +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 Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
byte_order_mark.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
changelog.rs
choose.rs Pass justfile path to default chooser (#1759) 2023-12-14 00:48:40 +00:00
command.rs Allow setting echoed recipe line color (#1670) 2023-10-11 00:04:34 +00:00
completions.rs
conditional.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
confirm.rs Add [confirm] attribute (#1723) 2023-11-16 23:51:34 +00:00
delimiters.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
dotenv.rs Add dotenv-filename and dotenv-path settings (#1692) 2023-10-12 05:04:46 +00:00
edit.rs Clean up error display (#1699) 2023-10-16 20:18:25 -07:00
equals.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
error_messages.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
evaluate.rs
examples.rs
export.rs
fallback.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
fmt.rs Clean up error display (#1699) 2023-10-16 20:18:25 -07:00
functions.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
ignore_comments.rs Fix spelling (#1463) 2022-12-30 20:36:08 +00:00
imports.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
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 Add modules (#1782) 2023-12-28 04:27:15 +00:00
lib.rs Print submodule recipes in --summary (#1794) 2023-12-29 03:06:48 +00:00
line_prefixes.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
misc.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
modules.rs Recipes can be invoked with path syntax (#1809) 2023-12-31 22:03:49 +00:00
multibyte_char.rs
newline_escape.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
no_cd.rs Add [no-cd] attribute (#1400) 2022-11-02 23:37:35 -07:00
no_exit_message.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
os_attributes.rs
parser.rs
positional_arguments.rs Pass evaluated arguments as positional arguments (#810) 2021-05-02 10:25:43 +00:00
private.rs Stabilize fallback (#1471) 2023-01-04 06:31:56 +00:00
quiet.rs Print submodule recipes in --summary (#1794) 2023-12-29 03:06:48 +00:00
quote.rs
readme.rs
recursion_limit.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
regexes.rs
run.rs
search_arguments.rs
search.rs
shadowing_parameters.rs
shebang.rs Run recipes with working directory set to submodule directory (#1788) 2023-12-29 00:55:36 +00:00
shell.rs
show.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
slash_operator.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
string.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
subsequents.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
summary.rs Print submodule recipes in --summary (#1794) 2023-12-29 03:06:48 +00:00
tempdir.rs
test.rs Add semver_matches function (#1713) 2023-10-27 20:07:46 +00:00
undefined_variables.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
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);
  }
}