just/tests
2024-05-21 06:22:56 +00:00
..
completions
allow_duplicate_recipes.rs
allow_duplicate_variables.rs Add 'allow-duplicate-variables' setting (#1922) 2024-05-15 01:39:42 +00:00
assert_stdout.rs
assert_success.rs
assertions.rs Add assert expression (#1845) 2024-05-15 01:55:32 +00:00
assignment.rs
attributes.rs Allow setting custom confirm prompt (#1834) 2024-01-13 02:44:13 +00:00
backticks.rs Fix output \r\n stripping (#2035) 2024-05-14 23:30:19 +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 Show submodule recipes in --choose (#2069) 2024-05-21 06:22:56 +00:00
command.rs Update clap to version 4 (#1924) 2024-05-14 20:29:40 -07:00
completions.rs
conditional.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
confirm.rs Allow setting custom confirm prompt (#1834) 2024-01-13 02:44:13 +00:00
constants.rs Add predefined constants (#2054) 2024-05-18 23:12:11 +00:00
delimiters.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
directories.rs Add functions to return XDG base directories (#1822) 2024-01-11 23:50:04 +00:00
dotenv.rs Make dotenv-path relative to working directory (#2040) 2024-05-15 04:31:58 +00:00
edit.rs
equals.rs
error_messages.rs Allow setting custom confirm prompt (#1834) 2024-01-13 02:44:13 +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 Update clap to version 4 (#1924) 2024-05-14 20:29:40 -07:00
functions.rs Pass command as first argument to shell (#2061) 2024-05-20 04:12:09 +00:00
global.rs Add --global-justfile flag (#1846) 2024-05-19 09:29:13 +00:00
ignore_comments.rs Fix function name typo (#1953) 2024-03-11 04:30:53 +00:00
imports.rs Allow multiple imports of the same file in different modules (#2065) 2024-05-20 08:04:03 +00:00
init.rs
interrupts.rs
invocation_directory.rs Add just_pid function (#1833) 2024-01-12 03:22:27 +00:00
json.rs Add assert expression (#1845) 2024-05-15 01:55:32 +00:00
lib.rs Fix submodule recipe listing indentation (#2063) 2024-05-20 07:25:18 +00:00
line_prefixes.rs
list.rs Fix submodule recipe listing indentation (#2063) 2024-05-20 07:25:18 +00:00
man.rs Add --man subcommand (#2041) 2024-05-15 07:28:50 +00:00
misc.rs Increase --list maximum alignable width from 30 to 50 (#2039) 2024-05-15 02:37:00 +00:00
modules.rs Fix submodule recipe listing indentation (#2063) 2024-05-20 07:25:18 +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_aliases.rs Add --no-aliases to hide aliases in --list (#1961) 2024-03-26 12:20:46 -07:00
no_cd.rs
no_dependencies.rs Add --no-deps to skip running recipe dependencies (#1819) 2024-01-09 08:40:08 +00: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
private.rs
quiet.rs Add set quiet and [no-quiet] (#1704) 2024-01-12 20:38:23 +00:00
quote.rs
readme.rs Cleanup (#2026) 2024-05-14 20:07:41 -07:00
recursion_limit.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
regexes.rs
run.rs
search.rs
search_arguments.rs
shadowing_parameters.rs
shebang.rs Use --command-color when printing shebang recipe commands (#1911) 2024-05-15 00:53:59 +00:00
shell.rs
shell_expansion.rs Allow shell expanded strings in mod and import paths (#2059) 2024-05-19 16:47:25 -07:00
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
tempdir.rs Use cache dir for temporary files (#2067) 2024-05-21 00:04:42 +00:00
test.rs Add shell-expanded strings (#2055) 2024-05-19 05:41:38 +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::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);
  }
}