-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
The scenario is this.
In your test functions, you have:
#[test]
fn test_ls() {
let process = Command::new(ls).arg("ln");
// we then test that ls works as expected
}
and we want to show the same example in our docs, but showing let process = Command::new(ls).arg("ln") is not great. Ideally, we want to use Debug/Display impl of the same process variable, which will nicely format it as ls -ln.
I suppose this can be done with
#[test]
fn test_ls() {
#[docify::export_display]
let process = Command::new(ls).arg("ln");
// we then test that ls works as expected
}
This is a very limited use-case. We can easily limit it to only work in assignment expressions, drop the lhs, assert rhs is a Command etc.
Metadata
Metadata
Assignees
Labels
No labels