use std::process::ExitStatus;
use std::{collections::HashSet, io};
pub trait Take {
fn assert_that(&mut self, t: bool) -> bool;
fn take(&mut self, t: bool, s: &str, e: &str) -> &mut Self;
fn check(&mut self, t: bool, s: &str, e: &str);
}
pub trait Theory {
fn chaos(&mut self, callback: &dyn Fn() -> bool) -> &mut Self;
fn theorem<T: PartialEq>(&mut self, expected: T, actual: &dyn Fn() -> T) -> &mut Self;
fn theory<T: PartialEq>(&mut self, expected: T, callback: &dyn Fn() -> T) -> &mut Self;
}
pub trait Failure {
fn command_fail(
&mut self,
callbacks: Vec<&dyn Fn() -> Result<ExitStatus, io::Error>>,
) -> &mut Self;
fn fail(&mut self, callbacks: Vec<&dyn Fn() -> bool>) -> &mut Self;
}
pub trait Success {
fn run(&mut self, callbacks: Vec<&dyn Fn() -> Result<ExitStatus, io::Error>>) -> &mut Self;
fn success(&mut self, callbacks: Vec<&dyn Fn() -> bool>) -> &mut Self;
}
pub trait Testable {
fn new(sleep_time: u64) -> Self;
fn matches(&mut self, pattern: &str, values: Vec<String>) -> &mut Self;
fn capture(&mut self, pattern: &str, x: &str, key: usize, values: Vec<String>) -> &mut Self;
fn ok(&mut self, f: bool) -> &mut Self;
fn ko(&mut self, f: bool) -> &mut Self;
fn assert(&mut self, test: bool) -> bool;
fn eq<T: PartialEq>(&mut self, a: T, b: T) -> &mut Self;
fn ne<T: PartialEq>(&mut self, a: T, b: T) -> &mut Self;
fn gt<T: PartialOrd>(&mut self, a: T, min: T) -> &mut Self;
fn ge<T: PartialOrd>(&mut self, a: T, min: T) -> &mut Self;
fn lt<T: PartialOrd>(&mut self, a: T, max: T) -> &mut Self;
fn le<T: PartialOrd>(&mut self, a: T, max: T) -> &mut Self;
fn between<T: PartialOrd>(&mut self, a: T, min: T, max: T) -> &mut Self;
fn vec_contains<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Self;
fn exe(&mut self, p: &str) -> &mut Self;
fn vec_no_contains<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Self;
fn option_contains<T: PartialEq>(&mut self, a: Option<T>, b: T) -> &mut Self;
fn hash_contains(&mut self, a: &mut HashSet<String>, b: String) -> &mut Self;
fn str_contains(&mut self, a: &str, b: &str) -> &mut Self;
fn file_contains(&mut self, f: &str, v: &str) -> &mut Self;
fn exists(&mut self, p: &str) -> &mut Self;
fn not_exists(&mut self, p: &str) -> &mut Self;
fn start_with(&mut self, actual: &str, expected: &str) -> &mut Self;
fn end_with(&mut self, actual: &str, expected: &str) -> &mut Self;
fn end(&mut self) -> bool;
fn it(
title: &str,
description: &str,
sleep_time: u64,
callbacks: Vec<&dyn Fn(&mut Self) -> &mut Self>,
);
}