just/tests/lib.rs

128 lines
2.1 KiB
Rust
Raw Permalink Normal View History

pub(crate) use {
crate::{
assert_stdout::assert_stdout,
assert_success::assert_success,
tempdir::tempdir,
2024-05-18 16:12:11 -07:00
test::{assert_eval_eq, Output, Test},
},
cradle::input::Input,
executable_path::executable_path,
just::unindent,
libc::{EXIT_FAILURE, EXIT_SUCCESS},
pretty_assertions::Comparison,
regex::Regex,
serde_json::{json, Value},
std::{
collections::BTreeMap,
env::{self, consts::EXE_SUFFIX},
error::Error,
fmt::Debug,
fs,
io::Write,
iter,
path::{Path, PathBuf, MAIN_SEPARATOR},
process::{Command, Stdio},
str,
},
tempfile::TempDir,
temptree::{temptree, tree, Tree},
which::which,
};
#[macro_use]
mod test;
2022-02-14 18:37:06 -08:00
mod allow_duplicate_recipes;
mod allow_duplicate_variables;
2021-07-03 14:26:59 -07:00
mod assert_stdout;
mod assert_success;
2024-05-14 18:55:32 -07:00
mod assertions;
mod attributes;
mod backticks;
mod byte_order_mark;
2021-07-31 13:53:27 -07:00
mod changelog;
mod choose;
2021-05-09 20:35:35 -07:00
mod command;
mod completions;
mod conditional;
2023-11-16 15:51:34 -08:00
mod confirm;
2024-05-18 16:12:11 -07:00
mod constants;
mod delimiters;
mod directories;
mod dotenv;
mod edit;
2021-10-01 18:37:28 -07:00
mod equals;
mod error_messages;
mod evaluate;
mod examples;
mod export;
2023-01-03 22:31:56 -08:00
mod fallback;
2021-06-08 01:01:27 -07:00
mod fmt;
mod functions;
2024-05-19 02:29:13 -07:00
#[cfg(unix)]
mod global;
2024-05-25 00:32:25 -07:00
mod groups;
mod ignore_comments;
mod imports;
mod init;
#[cfg(unix)]
mod interrupts;
mod invocation_directory;
2021-11-17 00:07:48 -08:00
mod json;
mod line_prefixes;
mod list;
2024-05-15 00:28:50 -07:00
mod man;
mod misc;
2023-12-27 20:27:15 -08:00
mod modules;
mod multibyte_char;
2023-07-25 02:05:47 -07:00
mod newline_escape;
mod no_aliases;
2022-11-02 23:37:35 -07:00
mod no_cd;
mod no_dependencies;
mod no_exit_message;
mod os_attributes;
mod parser;
mod positional_arguments;
mod private;
mod quiet;
mod quote;
mod readme;
mod recursion_limit;
mod regexes;
mod run;
mod search;
mod search_arguments;
mod shadowing_parameters;
mod shebang;
mod shell;
2024-05-18 22:41:38 -07:00
mod shell_expansion;
mod show;
2022-06-25 02:39:06 -07:00
mod slash_operator;
mod string;
mod subsequents;
mod summary;
mod tempdir;
mod timestamps;
mod undefined_variables;
mod unexport;
mod unstable;
2022-01-18 11:02:15 -08:00
#[cfg(target_family = "windows")]
2022-05-31 13:01:59 -07:00
mod windows_shell;
mod working_directory;
2023-01-03 22:31:56 -08:00
fn path(s: &str) -> String {
if cfg!(windows) {
s.replace('/', "\\")
} else {
s.into()
}
}
2023-01-12 19:25:28 -08:00
fn path_for_regex(s: &str) -> String {
if cfg!(windows) {
s.replace('/', "\\\\")
} else {
s.into()
}
}