just/tests
2024-09-21 05:25:52 +00:00
..
completions Don't check in auto-generated completion scripts (#2120) 2024-06-01 23:26:41 +00:00
allow_duplicate_recipes.rs Stabilize fallback (#1471) 2023-01-04 06:31:56 +00:00
allow_duplicate_variables.rs Add 'allow-duplicate-variables' setting (#1922) 2024-05-15 01:39:42 +00:00
assert_stdout.rs Add invocation_directory_native() (#1507) 2023-01-13 19:03:14 +00:00
assert_success.rs Add invocation_directory_native() (#1507) 2023-01-13 19:03:14 +00:00
assertions.rs Add assert expression (#1845) 2024-05-15 01:55:32 +00:00
assignment.rs Improve error message if if is missing the else (#1252) 2022-06-30 10:34:11 +00:00
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 Stabilize modules (#2250) 2024-07-14 21:22:03 +00:00
command.rs Add set dotenv-required to require an environment file (#2116) 2024-05-30 23:12:07 +00:00
completions.rs Group commands under dedicated heading in --help output (#2302) 2024-08-05 22:31:06 +00:00
conditional.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
confirm.rs Add unstable [script(…)] attribute (#2259) 2024-07-17 22:59:18 -07:00
constants.rs Add predefined constants (#2054) 2024-05-18 23:12:11 +00:00
datetime.rs Add datetime() and datetime_utc() functions (#2167) 2024-06-14 22:48:34 -07: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 set dotenv-path does not override set dotenv-filename (#2262) 2024-07-18 19:49:52 +00:00
edit.rs Remove dependency on cradle (#2169) 2024-06-18 02:42:16 +00:00
equals.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
error_messages.rs Fix type names in redefinition error message (#2353) 2024-09-13 08:45:32 +00:00
evaluate.rs Allow [private] attribute on assignments (#2300) 2024-08-10 18:22:07 +00:00
examples.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
explain.rs Print recipe doc string when--explain flag is passed (#2319) 2024-08-29 19:13:58 +00:00
export.rs Add dotenv-load setting (#778) 2021-03-28 22:38:07 -07:00
fallback.rs Allow fallback with recipes in submodules (#2329) 2024-08-28 22:10:40 +00:00
fmt.rs Add unstable [script(…)] attribute (#2259) 2024-07-17 22:59:18 -07:00
functions.rs Make function paths relative to correct working directory (#2294) 2024-08-02 19:20:07 +00:00
global.rs Add --global-justfile flag (#1846) 2024-05-19 09:29:13 +00:00
groups.rs Remove (no group) header before ungrouped recipes (#2268) 2024-07-21 23:41:29 +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 Fix Rust 1.80.0 warnings (#2281) 2024-07-27 22:00:19 +00:00
invocation_directory.rs Fix Rust 1.80.0 warnings (#2281) 2024-07-27 22:00:19 +00:00
json.rs Allow [private] attribute on assignments (#2300) 2024-08-10 18:22:07 +00:00
lib.rs Allow default values to use earlier recipe arguments (#2382) 2024-09-21 03:54:38 +00:00
line_prefixes.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
list.rs Remove (no group) header before ungrouped recipes (#2268) 2024-07-21 23:41:29 +00:00
man.rs Add --man subcommand (#2041) 2024-05-15 07:28:50 +00:00
misc.rs Allow default values to use earlier recipe arguments (#2382) 2024-09-21 03:54:38 +00:00
modules.rs Fix Rust 1.80.0 warnings (#2281) 2024-07-27 22:00:19 +00:00
multibyte_char.rs Fix multibyte codepoint crash (#1243) 2022-06-21 00:24:13 +00:00
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 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 Fix Rust 1.80.0 warnings (#2281) 2024-07-27 22:00:19 +00:00
os_attributes.rs Add OS Configuration Attributes (#1387) 2022-10-31 00:52:03 -07:00
parameters.rs Allow default values to use earlier recipe arguments (#2382) 2024-09-21 03:54:38 +00:00
parser.rs Allow comments on same line as settings (#1339) 2022-09-10 15:19:49 -07:00
positional_arguments.rs Fix Rust 1.80.0 warnings (#2281) 2024-07-27 22:00:19 +00:00
private.rs Allow [private] attribute on assignments (#2300) 2024-08-10 18:22:07 +00:00
quiet.rs Fix Rust 1.80.0 warnings (#2281) 2024-07-27 22:00:19 +00:00
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 Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
run.rs Add --one flag to forbid multiple recipes from being invoked on the command line (#2374) 2024-09-21 05:25:52 +00:00
script.rs Keep multi-line shebangs together (#2276) 2024-07-31 02:21:41 +00:00
search.rs Lexiclean search directory so .. does not check the current directory (#2236) 2024-07-08 02:12:07 +00:00
search_arguments.rs Test passing dot as argument between justfiles (#1530) 2023-01-25 05:33:43 +00:00
shadowing_parameters.rs Allow recipe parameters to shadow variables (#1480) 2023-01-10 00:59:02 +00:00
shebang.rs Keep multi-line shebangs together (#2276) 2024-07-31 02:21:41 +00:00
shell.rs Test shell not found error messages (#2145) 2024-06-11 13:10:32 -07:00
shell_expansion.rs Stabilize modules (#2250) 2024-07-14 21:22:03 +00:00
show.rs Stabilize modules (#2250) 2024-07-14 21:22:03 +00:00
slash_operator.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
string.rs Allow including arbitrary characters in strings with \u{…} (#2360) 2024-09-15 09:59:52 +00:00
subsequents.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
summary.rs Stabilize modules (#2250) 2024-07-14 21:22:03 +00:00
tempdir.rs Add unstable [script(…)] attribute (#2259) 2024-07-17 22:59:18 -07:00
test.rs Fix Rust 1.80.0 warnings (#2281) 2024-07-27 22:00:19 +00:00
timestamps.rs Add --timestamp-format (#2106) 2024-05-29 09:28:45 +00:00
undefined_variables.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
unexport.rs Fix unexport syntax conflicts (#2158) 2024-06-14 19:39:34 +00:00
unstable.rs Stabilize modules (#2250) 2024-07-14 21:22:03 +00:00
windows.rs Test bare bash path in shebang on windows (#2144) 2024-06-13 19:19:22 +00:00
windows_shell.rs Fix spelling (#1463) 2022-12-30 20:36:08 +00:00
working_directory.rs Use correct backtick and shell() expression working directory in submodules (#2285) 2024-07-30 18:51:57 -07: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);
  }
}