forked from extern/nushell
Add (near) automatic testing for command examples (#1777)
This commit is contained in:
@ -58,3 +58,15 @@ fn range(args: CommandArgs, registry: &CommandRegistry) -> Result<OutputStream,
|
||||
|
||||
Ok(stream.to_output_stream())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::Range;
|
||||
|
||||
#[test]
|
||||
fn examples_work_as_expected() {
|
||||
use crate::examples::test as test_examples;
|
||||
|
||||
test_examples(Range {})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user