just/tests
2024-01-27 02:10:33 +00:00
..
completions
allow_duplicate_recipes.rs
assert_stdout.rs
assert_success.rs
assignment.rs
attributes.rs Allow setting custom confirm prompt (#1834) 2024-01-13 02:44:13 +00:00
byte_order_mark.rs
changelog.rs Stabilize fallback (#1471) 2023-01-04 06:31:56 +00:00
choose.rs
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
directories.rs Add functions to return XDG base directories (#1822) 2024-01-11 23:50:04 +00:00
dotenv.rs Use unlikely-to-be-set variable name in env tests (#1882) 2024-01-27 02:10:33 +00:00
edit.rs
equals.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
error_messages.rs
evaluate.rs Add / operator (#1237) 2022-06-25 09:39:06 +00:00
examples.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
export.rs Add dotenv-load setting (#778) 2021-03-28 22:38:07 -07:00
fallback.rs
fmt.rs Skip write_error test if running as root (#1881) 2024-01-26 21:18:51 +00:00
functions.rs Add function to canonicalize paths (#1859) 2024-01-19 20:04:28 +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
interrupts.rs
invocation_directory.rs Add just_pid function (#1833) 2024-01-12 03:22:27 +00:00
json.rs
lib.rs Add functions to return XDG base directories (#1822) 2024-01-11 23:50:04 +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 Ignore [private] recipes in just --list (#1816) 2024-01-09 08:07:43 +00:00
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
no_exit_message.rs
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
private.rs Stabilize fallback (#1471) 2023-01-04 06:31:56 +00:00
quiet.rs Add set quiet and [no-quiet] (#1704) 2024-01-12 20:38:23 +00:00
quote.rs Stabilize fallback (#1471) 2023-01-04 06:31:56 +00:00
readme.rs Eliminate lazy_static (#1442) 2022-12-15 16:53:21 -08:00
recursion_limit.rs
regexes.rs
run.rs Stabilize fallback (#1471) 2023-01-04 06:31:56 +00:00
search_arguments.rs
search.rs Misc fixes (#1700) 2023-10-17 03:07:09 +00:00
shadowing_parameters.rs
shebang.rs Convert run_shebang into integration test (#1880) 2024-01-26 13:05:32 -08:00
shell.rs
show.rs Use box-drawing characters in error messages (#1798) 2023-12-29 21:25:30 +00:00
slash_operator.rs
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 Add function to canonicalize paths (#1859) 2024-01-19 20:04:28 +00:00
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 Fix spelling (#1463) 2022-12-30 20:36:08 +00:00
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);
  }
}