tests: nb arguments

main
blob42 7 months ago
parent b6e93bd5cc
commit d337639a94

@ -1,6 +1,6 @@
1. parse cli parameters
2. read from stdin
3. split stdin into columns (column/awk commands)
1. parse cli parameters
2. read from stdin
3. split stdin into columns
3. map (execute) commands to fields
- [ ] execute a command on first text column
4. print resulting concatenated columns

@ -104,19 +104,9 @@ fn main() -> Result<()> {
assert!(input_text.n_cols()? >= cli.yargs.len());
// TODO: RESULT
print!("{}", raw_input);
//
// cmd.error(ErrorKind::ValueValidation, "invalid")
// .exit()
// validate number of
Ok(())
}

@ -1,5 +1,3 @@
//TODO:
use std::error::Error;
use assert_cmd::Command;
// use assert_cmd::prelude::*;
@ -52,3 +50,15 @@ fn fail_yargs_mismatch1() -> TestResult {
}
// n args <= n cols
#[test]
fn cli_pass2() -> TestResult {
run_args("tests/inputs/input1", &["1", "2", "3", "4", "5", "6"])
}
#[test]
#[should_panic]
// more arguments passed than columns
fn cli_fail1() {
run_args("tests/inputs/input1", &["1", "2", "3", "4", "5", "6", "7", "8"]).unwrap()
}

Loading…
Cancel
Save