just/tests
2024-07-15 13:08:28 -07:00
..
completions
allow_duplicate_recipes.rs Stabilize fallback (#1471) 2023-01-04 06:31:56 +00:00
allow_duplicate_variables.rs
assert_stdout.rs
assert_success.rs Add invocation_directory_native() (#1507) 2023-01-13 19:03:14 +00:00
assertions.rs
assignment.rs
attributes.rs Add [extension: 'EXT'] attribute to set shebang recipe script file extension (#2256) 2024-07-15 13:08:28 -07: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 Stabilize fallback (#1471) 2023-01-04 06:31:56 +00:00
choose.rs
command.rs Add set dotenv-required to require an environment file (#2116) 2024-05-30 23:12:07 +00:00
completions.rs
conditional.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
confirm.rs
constants.rs Add predefined constants (#2054) 2024-05-18 23:12:11 +00:00
datetime.rs
delimiters.rs
directories.rs Add functions to return XDG base directories (#1822) 2024-01-11 23:50:04 +00:00
dotenv.rs Load environment file from dotenv-path relative to working directory (#2152) 2024-06-13 20:21:00 +00:00
edit.rs
equals.rs
error_messages.rs
evaluate.rs Add / operator (#1237) 2022-06-25 09:39:06 +00:00
examples.rs
export.rs Add dotenv-load setting (#778) 2021-03-28 22:38:07 -07:00
fallback.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
fmt.rs Allow enabling unstable features with set unstable (#2237) 2024-07-08 03:45:03 +00:00
functions.rs Stabilize modules (#2250) 2024-07-14 21:22:03 +00:00
global.rs
groups.rs List recipes by group in group justfile order with just --list --unsorted (#2164) 2024-06-15 03:04:47 +00:00
ignore_comments.rs Don't analyze comments when ignore-comments is set (#2180) 2024-06-21 20:39:34 +00:00
imports.rs Stabilize modules (#2250) 2024-07-14 21:22:03 +00:00
init.rs Add invocation_directory_native() (#1507) 2023-01-13 19:03:14 +00:00
interrupts.rs
invocation_directory.rs
json.rs
lib.rs Allow mod path to be directory containing module source (#2238) 2024-07-08 22:38:25 +00:00
line_prefixes.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
list.rs
man.rs Add --man subcommand (#2041) 2024-05-15 07:28:50 +00:00
misc.rs Improve argument parsing and error handling for submodules (#2154) 2024-06-14 02:41:45 +00:00
modules.rs Suppress mod doc comment with empty [doc] attribute (#2254) 2024-07-15 16:27:48 +00:00
multibyte_char.rs Fix multibyte codepoint crash (#1243) 2022-06-21 00:24:13 +00:00
newline_escape.rs
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
no_exit_message.rs Allow [doc] annotation on modules (#2247) 2024-07-14 22:15:22 -07:00
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 Add [positional-arguments] attribute (#2151) 2024-06-13 19:35:14 +00:00
private.rs Stabilize fallback (#1471) 2023-01-04 06:31:56 +00:00
quiet.rs
quote.rs Stabilize fallback (#1471) 2023-01-04 06:31:56 +00:00
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 Stabilize fallback (#1471) 2023-01-04 06:31:56 +00:00
search_arguments.rs
search.rs Lexiclean search directory so .. does not check the current directory (#2236) 2024-07-08 02:12:07 +00:00
shadowing_parameters.rs
shebang.rs Use --command-color when printing shebang recipe commands (#1911) 2024-05-15 00:53:59 +00:00
shell_expansion.rs Stabilize modules (#2250) 2024-07-14 21:22:03 +00:00
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
tempdir.rs Write shebang recipes to $XDG_RUNTIME_DIR (#2128) 2024-06-05 19:03:14 +00:00
test.rs Stabilize modules (#2250) 2024-07-14 21:22:03 +00:00
timestamps.rs Add --timestamp-format (#2106) 2024-05-29 09:28:45 +00:00
undefined_variables.rs
unexport.rs
unstable.rs Stabilize modules (#2250) 2024-07-14 21:22:03 +00:00
windows_shell.rs
windows.rs Test bare bash path in shebang on windows (#2144) 2024-06-13 19:19:22 +00:00
working_directory.rs Placate clippy (#1423) 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);
  }
}