1
1
mirror of https://github.com/casey/just.git synced 2024-11-23 02:44:56 +03:00
just/tests/lib.rs

135 lines
2.2 KiB
Rust
Raw Normal View History

pub(crate) use {
crate::{
assert_stdout::assert_stdout,
assert_success::assert_success,
tempdir::tempdir,
2024-05-19 02:12:11 +03:00
test::{assert_eval_eq, Output, Test},
},
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, MAIN_SEPARATOR_STR},
process::{Command, Stdio},
str,
},
tempfile::TempDir,
temptree::{temptree, tree, Tree},
which::which,
};
#[macro_use]
mod test;
2022-02-15 05:37:06 +03:00
mod allow_duplicate_recipes;
mod allow_duplicate_variables;
2021-07-04 00:26:59 +03:00
mod assert_stdout;
mod assert_success;
2024-05-15 04:55:32 +03:00
mod assertions;
mod assignment;
mod attributes;
mod backticks;
mod byte_order_mark;
2021-07-31 23:53:27 +03:00
mod changelog;
mod choose;
2021-05-10 06:35:35 +03:00
mod command;
mod completions;
mod conditional;
2023-11-17 02:51:34 +03:00
mod confirm;
2024-05-19 02:12:11 +03:00
mod constants;
mod datetime;
mod delimiters;
mod directories;
mod dotenv;
mod edit;
2021-10-02 04:37:28 +03:00
mod equals;
mod error_messages;
mod evaluate;
mod examples;
mod explain;
mod export;
2023-01-04 09:31:56 +03:00
mod fallback;
2021-06-08 11:01:27 +03:00
mod fmt;
mod functions;
2024-05-19 12:29:13 +03:00
#[cfg(unix)]
mod global;
2024-05-25 10:32:25 +03:00
mod groups;
mod ignore_comments;
mod imports;
mod init;
#[cfg(unix)]
mod interrupts;
mod invocation_directory;
2021-11-17 11:07:48 +03:00
mod json;
mod line_prefixes;
mod list;
2024-11-01 03:54:46 +03:00
mod logical_operators;
2024-05-15 10:28:50 +03:00
mod man;
mod misc;
2023-12-28 07:27:15 +03:00
mod modules;
mod multibyte_char;
2023-07-25 12:05:47 +03:00
mod newline_escape;
mod no_aliases;
2022-11-03 09:37:35 +03:00
mod no_cd;
mod no_dependencies;
mod no_exit_message;
mod os_attributes;
mod parameters;
mod parser;
mod positional_arguments;
mod private;
mod quiet;
mod quote;
mod readme;
mod recursion_limit;
mod regexes;
mod run;
mod script;
mod search;
mod search_arguments;
mod shadowing_parameters;
mod shebang;
mod shell;
2024-05-19 08:41:38 +03:00
mod shell_expansion;
mod show;
2022-06-25 12:39:06 +03:00
mod slash_operator;
mod string;
mod subsequents;
mod summary;
mod tempdir;
mod timestamps;
mod undefined_variables;
mod unexport;
mod unstable;
#[cfg(windows)]
mod windows;
2022-01-18 22:02:15 +03:00
#[cfg(target_family = "windows")]
2022-05-31 23:01:59 +03:00
mod windows_shell;
mod working_directory;
2023-01-04 09:31:56 +03:00
fn path(s: &str) -> String {
if cfg!(windows) {
s.replace('/', "\\")
} else {
s.into()
}
}
2023-01-13 06:25:28 +03:00
fn path_for_regex(s: &str) -> String {
if cfg!(windows) {
s.replace('/', "\\\\")
} else {
s.into()
}
}