just/tests
2024-02-11 20:56:04 +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 Stabilize fallback (#1471) 2023-01-04 06:31:56 +00:00
assert_stdout.rs
assert_success.rs Add invocation_directory_native() (#1507) 2023-01-13 19:03:14 +00:00
assignment.rs
attributes.rs
byte_order_mark.rs
changelog.rs
choose.rs Pass justfile path to default chooser (#1759) 2023-12-14 00:48:40 +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 Allow setting custom confirm prompt (#1834) 2024-01-13 02:44:13 +00:00
delimiters.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
directories.rs
dotenv.rs
edit.rs
equals.rs
error_messages.rs
evaluate.rs
examples.rs
export.rs
fallback.rs
fmt.rs
functions.rs Add blake3 and blake3_file functions (#1860) 2024-02-11 20:56:04 +00:00
ignore_comments.rs Fix spelling (#1463) 2022-12-30 20:36:08 +00:00
imports.rs Run imports in working directory of importer (#1817) 2024-01-12 03:00:38 +00:00
init.rs Add invocation_directory_native() (#1507) 2023-01-13 19:03:14 +00:00
interrupts.rs
invocation_directory.rs Add just_pid function (#1833) 2024-01-12 03:22:27 +00:00
json.rs
lib.rs
line_prefixes.rs
misc.rs
modules.rs
multibyte_char.rs
newline_escape.rs
no_cd.rs Add [no-cd] attribute (#1400) 2022-11-02 23:37:35 -07:00
no_dependencies.rs Add --no-deps to skip running recipe dependencies (#1819) 2024-01-09 08:40:08 +00:00
no_exit_message.rs
os_attributes.rs
parser.rs
positional_arguments.rs
private.rs
quiet.rs
quote.rs Stabilize fallback (#1471) 2023-01-04 06:31:56 +00:00
readme.rs
recursion_limit.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
regexes.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
run.rs
search_arguments.rs Test passing dot as argument between justfiles (#1530) 2023-01-25 05:33:43 +00:00
search.rs
shadowing_parameters.rs
shebang.rs
shell.rs
show.rs
slash_operator.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
string.rs
subsequents.rs
summary.rs Print submodule recipes in --summary (#1794) 2023-12-29 03:06:48 +00:00
tempdir.rs Misc fixes (#1700) 2023-10-17 03:07:09 +00:00
test.rs
undefined_variables.rs
unstable.rs Allow unstable features to be enabled with environment variable (#1588) 2023-10-09 03:47:20 +00:00
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);
  }
}