fec979c2c6
- Combine and simplify string and backtick lexing. - Allow newlines in strings and backticks. - Add triple-delimited indented strings and backticks. Common indented literal non-blank line leading whitespace is stripped. - If a literal newline is escaped, it will be suppressed. - Backticks starting with `#!` are reserved for a future upgrade. |
||
---|---|---|
.. | ||
choose.rs | ||
common.rs | ||
completions.rs | ||
conditional.rs | ||
delimiters.rs | ||
dotenv.rs | ||
edit.rs | ||
error_messages.rs | ||
evaluate.rs | ||
examples.rs | ||
export.rs | ||
init.rs | ||
interrupts.rs | ||
invocation_directory.rs | ||
lib.rs | ||
misc.rs | ||
quiet.rs | ||
readme.rs | ||
search.rs | ||
shell.rs | ||
string.rs | ||
test.rs | ||
working_directory.rs |
use std::{fs, process::Command}; use executable_path::executable_path; use test_utilities::{assert_success, tempdir}; #[test] fn readme() { let mut justfiles = vec![]; let mut current = None; for line in fs::read_to_string("README.adoc").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); } }