1
1
mirror of https://github.com/casey/just.git synced 2024-11-26 23:27:26 +03:00
just/tests
2022-10-25 16:57:32 -07:00
..
completions Inline setup and cleanup functions in completion script test (#1352) 2022-09-23 20:54:18 -07:00
allow_duplicate_recipes.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
assert_stdout.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
assert_success.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
assignment.rs Improve error message if if is missing the else (#1252) 2022-06-30 10:34:11 +00:00
byte_order_mark.rs Add [no-exit-message] recipe annotation (#1354) 2022-10-25 16:32:36 -07:00
changelog.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
choose.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
command.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
completions.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
conditional.rs Improve error message if if is missing the else (#1252) 2022-06-30 10:34:11 +00:00
delimiters.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
dotenv.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
edit.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
equals.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
error_messages.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
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
fall_back_to_parent.rs Require set fallback := true to enable recipe fallback (#1368) 2022-10-19 19:00:09 -07:00
fmt.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
functions.rs Add capitalize(s) function (#1375) 2022-10-24 20:39:40 -07:00
ignore_comments.rs Don't evaluate comments (#1358) 2022-10-04 22:33:19 -07:00
init.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
interrupts.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
invocation_directory.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
json.rs Add tempdir setting (#1369) 2022-10-25 16:57:32 -07:00
lib.rs Add [no-exit-message] recipe annotation (#1354) 2022-10-25 16:32:36 -07:00
line_prefixes.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
misc.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
multibyte_char.rs Fix multibyte codepoint crash (#1243) 2022-06-21 00:24:13 +00:00
no_exit_message.rs Add [no-exit-message] recipe annotation (#1354) 2022-10-25 16:32:36 -07:00
parser.rs Allow comments on same line as settings (#1339) 2022-09-10 15:19:49 -07:00
positional_arguments.rs Pass evaluated arguments as positional arguments (#810) 2021-05-02 10:25:43 +00:00
quiet.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
quote.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
readme.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
recursion_limit.rs Improve error message if if is missing the else (#1252) 2022-06-30 10:34:11 +00:00
regexes.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
run.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
search.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
shebang.rs Add shebang support for 'cmd.exe' (#828) 2021-05-16 00:33:41 -05:00
shell.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
show.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
slash_operator.rs Allow constructing absolute paths with / operator (#1320) 2022-09-11 07:48:02 +00:00
string.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
sublime_syntax.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
subsequents.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
tempdir.rs Add tempdir setting (#1369) 2022-10-25 16:57:32 -07:00
test.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
undefined_variables.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +00:00
windows_shell.rs Fix shell setting precedence (#1306) 2022-08-09 02:50:31 +00:00
working_directory.rs Do use super::*; instead of use crate::common::*; (#1239) 2022-06-19 04:56:31 +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 == "```make" {
      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);
  }
}