Improve test coverage of command examples (#5650)

* Ignore `cargo tarpaulin` output files

* Add expected result for `columns` example

Examples without provided expected output will never be tested.
The subset of commands available in `test_examples()` is limited thus
excluding the tests depending on other commands

* Add example test harness to `reject`

* Test and fix `wrap` example

* Test and fix `drop column` example

* Update `from ods` examples

* Update `from xlsx` examples

* Run `to nuon` examples

* Run `hash base64` examples

* Add example output to `path parse`

* Test and fix the `grid` examples
This commit is contained in:
Stefan Holderbach
2022-05-26 20:51:31 +02:00
committed by GitHub
parent 230c36f2fb
commit 507f24d029
11 changed files with 156 additions and 26 deletions

View File

@ -232,9 +232,15 @@ fn action(
#[cfg(test)]
mod tests {
use super::{action, ActionType, Base64Config};
use super::{action, ActionType, Base64, Base64Config};
use nu_protocol::{Span, Value};
#[test]
fn test_examples() {
use crate::test_examples;
test_examples(Base64 {})
}
#[test]
fn base64_encode_standard() {
let word = Value::string("username:password", Span::test_data());