cli-sandbox is a sandboxing environment and testing utility to help you test and debug your CLI applications, inspired by Cargo's cargo-test-support.
All tests get their own temporary directories, where you can create files, check files, test your program against those files and check the output of your program in various ways.
For example, if you want to check that your Python to Rust transpiler works correctly:
use ;
use Error;
You can also get the path of a project (it changes each time the tests are executed, they're temporary).
Installation
Usage
The first step is to create a Project. You can use either Project::new() or project(). This will create a temporary directory for you to put all your testing files in there.
From a project, you can execute commands, do I/O operations or even operate over it manually by getting the project's path (Project::path()).
Check the project's documentation for more info.
Features
- Regex support for checking
stdoutandstderr. (feature:regex) - All output is beautiful thanks to
pretty-assertionsandbetter_panic. (feature:pretty, also can be enabled individually) - Little fuzzing functionality (feature:
fuzz) - Testing either the
debugorreleaseprofile (features:devorrelease)
Contributing
Check the [CONTRIBUTING.md] file for some guidelines on how to contribute. All contributions are welcomed, any size from contributors with all levels of experience!
LICENSE
we use the MIT License, check the [LICENSE] file for more information