just/tests
2022-05-04 23:18:31 +00:00
..
allow_duplicate_recipes.rs Allow duplicate recipes (#1095) 2022-02-15 02:37:06 +00:00
assert_stdout.rs Remove test-utilities crate (#892) 2021-07-03 21:26:59 +00:00
assert_success.rs Remove test-utilities crate (#892) 2021-07-03 21:26:59 +00:00
byte_order_mark.rs Ignore leading byte order mark in source files (#1021) 2021-11-05 04:35:57 +00:00
changelog.rs Add --changelog subcommand (#932) 2021-07-31 20:53:27 +00:00
choose.rs Fix windows chooser invocation error message test (#1079) 2022-01-30 20:32:38 +00:00
command.rs Change dotenv-load default to false (#1082) 2022-02-02 03:16:35 +00:00
common.rs Search for missing recipes in parent directory justfiles (#1149) 2022-03-31 05:13:59 +00:00
completions.rs Remove test-utilities crate (#892) 2021-07-03 21:26:59 +00:00
conditional.rs Implement regular expression match conditionals (#970) 2021-09-16 23:45:56 +00:00
delimiters.rs Allow ignore line endings inside delimiters (#717) 2020-10-27 23:51:17 -07:00
dotenv.rs Search for missing recipes in parent directory justfiles (#1149) 2022-03-31 05:13:59 +00:00
edit.rs Release 0.10.1 (#958) 2021-08-28 00:21:59 +00:00
equals.rs Remove deprecated equals error (#985) 2021-10-02 01:37:28 +00:00
error_messages.rs Fix colors (#927) 2021-07-29 01:27:47 +00:00
evaluate.rs Change --eval to print variable value only (#806) 2021-04-25 17:02:57 -07:00
examples.rs Remove test-utilities crate (#892) 2021-07-03 21:26:59 +00:00
export.rs Add dotenv-load setting (#778) 2021-03-28 22:38:07 -07:00
fall_back_to_parent.rs Search for missing recipes in parent directory justfiles (#1149) 2022-03-31 05:13:59 +00:00
fmt.rs Add color to just --fmt --check diff (#1015) 2021-11-01 06:18:11 +00:00
functions.rs SHA-256 and UUID functions (#1170) 2022-05-04 23:18:31 +00:00
init.rs Format --init justfile (#1116) 2022-02-23 19:47:43 +00:00
interrupts.rs Remove test-utilities crate (#892) 2021-07-03 21:26:59 +00:00
invocation_directory.rs Remove test-utilities crate (#892) 2021-07-03 21:26:59 +00:00
json.rs Allow duplicate recipes (#1095) 2022-02-15 02:37:06 +00:00
lib.rs Skip duplicate recipe arguments (#1174) 2022-05-04 05:04:55 +00:00
line_prefixes.rs Allow using - and @ in any order (#1063) 2022-01-03 00:51:22 +00:00
misc.rs Change dotenv-load default to false (#1082) 2022-02-02 03:16:35 +00:00
positional_arguments.rs Pass evaluated arguments as positional arguments (#810) 2021-05-02 10:25:43 +00:00
quiet.rs Turn = deprecation warning into a hard error (#780) 2021-03-28 23:39:23 -07:00
quote.rs Add quote(s) function for escaping strings (#1022) 2021-11-08 19:22:58 +00:00
readme.rs Remove asciidoc readme (#1092) 2022-02-07 00:22:14 +00:00
regexes.rs Implement regular expression match conditionals (#970) 2021-09-16 23:45:56 +00:00
run.rs Skip duplicate recipe arguments (#1174) 2022-05-04 05:04:55 +00:00
search.rs Support .justfile as an alternative to justfile (#931) 2021-07-31 19:25:49 +00:00
shebang.rs Add shebang support for 'cmd.exe' (#828) 2021-05-16 00:33:41 -05:00
shell.rs Remove test-utilities crate (#892) 2021-07-03 21:26:59 +00:00
show.rs Add loader and refactor errors (#917) 2021-07-26 01:26:06 -07:00
string.rs Reform and improve string literals (#793) 2021-04-05 21:28:37 -07:00
sublime_syntax.rs Add file_extensions to Sublime syntax file (#878) 2021-06-24 08:24:12 +00:00
subsequents.rs Add subsequent dependencies (#820) 2021-07-22 00:20:25 -07:00
tempdir.rs Remove test-utilities crate (#892) 2021-07-03 21:26:59 +00:00
test.rs SHA-256 and UUID functions (#1170) 2022-05-04 23:18:31 +00:00
undefined_variables.rs Don't skip variables in variable iterator (#991) 2021-10-09 05:04:13 +00:00
windows_powershell.rs Add windows-powershell setting (#1057) 2022-01-18 19:02:15 +00:00
working_directory.rs Remove test-utilities crate (#892) 2021-07-03 21:26:59 +00:00

use crate::common::*;

#[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);
  }
}