mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-03 18:30:32 +08:00
Most of this is taken from Jujutsu's own testing setup, see: https://github.com/jj-vcs/jj/blob/98d884827e2b9db72d480bb0c3610e51f103b7d4/cli/tests/common/test_environment.rs#L106-L150 Not all features are preserved, but this is good enough.
radicle-cli-test
Test your CLI with the help of markdown descriptions.
Example
Test flows are described in markdown like this example:
# Echoing works
When I call echo, it answers:
```
$ echo "ohai"
ohai
```
Say this is placed in kind-echo.md, this is what the corresponding test case
would look lke:
use std::path::Path;
use radicle_cli_test::TestFormula;
#[test]
fn kind_echo() {
TestFormula::new()
.file(Path::new("./kind-echo.md"))
.unwrap()
.run()
.unwrap();
}