just/tests
2023-07-25 09:14:13 +00:00
..
completions
allow_duplicate_recipes.rs
assert_stdout.rs
assert_success.rs Add invocation_directory_native() (#1507) 2023-01-13 19:03:14 +00:00
assignment.rs
attributes.rs Allow multiple attributes on one line (#1537) 2023-01-27 07:54:24 +00:00
byte_order_mark.rs Add [no-exit-message] recipe annotation (#1354) 2022-10-25 16:32:36 -07:00
changelog.rs
choose.rs Allow selecting multiple recipes with default chooser (#1547) 2023-06-12 17:06:51 +00:00
command.rs
completions.rs
conditional.rs
delimiters.rs
dotenv.rs Stabilize fallback (#1471) 2023-01-04 06:31:56 +00:00
edit.rs
equals.rs
error_messages.rs
evaluate.rs
examples.rs
export.rs
fallback.rs
fmt.rs
functions.rs Downgrade to TLS 1.2 in install script (#1536) 2023-01-27 02:49:03 +00:00
ignore_comments.rs Fix spelling (#1463) 2022-12-30 20:36:08 +00:00
includes.rs
init.rs Add invocation_directory_native() (#1507) 2023-01-13 19:03:14 +00:00
interrupts.rs Downgrade to TLS 1.2 in install script (#1536) 2023-01-27 02:49:03 +00:00
invocation_directory.rs Downgrade to TLS 1.2 in install script (#1536) 2023-01-27 02:49:03 +00:00
json.rs Stabilize JSON dump format (#1633) 2023-06-29 21:12:55 +00:00
lib.rs
line_prefixes.rs
misc.rs
multibyte_char.rs Fix multibyte codepoint crash (#1243) 2022-06-21 00:24:13 +00:00
newline_escape.rs Test unpaired escaped carriage return error (#1650) 2023-07-25 09:14:13 +00:00
no_cd.rs
no_exit_message.rs
os_attributes.rs Add OS Configuration Attributes (#1387) 2022-10-31 00:52:03 -07:00
parser.rs
positional_arguments.rs Pass evaluated arguments as positional arguments (#810) 2021-05-02 10:25:43 +00:00
private.rs Stabilize fallback (#1471) 2023-01-04 06:31:56 +00:00
quiet.rs
quote.rs
readme.rs
recursion_limit.rs
regexes.rs
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 Add shebang support for 'cmd.exe' (#828) 2021-05-16 00:33:41 -05:00
shell.rs
show.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
slash_operator.rs Stabilize fallback (#1471) 2023-01-04 06:31:56 +00:00
string.rs
subsequents.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
tempdir.rs Omit shebang lines on Windows (#1417) 2022-11-19 20:38:41 +00:00
test.rs Cleanup (#1566) 2023-06-12 16:53:55 +00:00
undefined_variables.rs
windows_shell.rs Fix spelling (#1463) 2022-12-30 20:36:08 +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![];
  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);
  }
}