mirror of
https://github.com/theryangeary/choose
synced 2024-11-10 05:24:13 +00:00
Add regression tests for #16
This commit is contained in:
parent
263f64e674
commit
fc6a2ddbda
3 changed files with 12 additions and 0 deletions
|
@ -1071,6 +1071,11 @@ mod tests {
|
|||
fn print_neg_2_to_end_character_wise_rust_syntax_exclusive() {
|
||||
test_fn(vec!["choose", "-2..", "-c"], "abcd\n", "cd");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn print_2_exclusive() {
|
||||
test_fn(vec!["choose", "2", "-x"], "a b c d", "c");
|
||||
}
|
||||
}
|
||||
|
||||
mod is_reverse_range_tests {
|
||||
|
|
6
test/choose_2_x.txt
Normal file
6
test/choose_2_x.txt
Normal file
|
@ -0,0 +1,6 @@
|
|||
dolor
|
||||
labore
|
||||
ullamco
|
||||
irure
|
||||
pariatur.
|
||||
officia
|
|
@ -18,6 +18,7 @@ diff -w <(cargo run -- 1:3 -o % -i ${test_dir}/lorem.txt 2>/dev/null) <(cat "${t
|
|||
diff -w <(cargo run -- 1 3 -o % -i ${test_dir}/lorem.txt 2>/dev/null) <(cat "${test_dir}/choose_1_3of%.txt")
|
||||
diff -w <(cargo run -- 1 3 -o '' -i ${test_dir}/lorem.txt 2>/dev/null) <(cat "${test_dir}/choose_1_3of.txt")
|
||||
diff -w <(cargo run -- 3:6 -c -i ${test_dir}/lorem.txt 2>/dev/null) <(cat "${test_dir}/choose_0_3_c.txt")
|
||||
diff -w <(cargo run -- 2 -x -i ${test_dir}/lorem.txt 2>/dev/null) <(cat "${test_dir}/choose_2_x.txt")
|
||||
# add tests for different delimiters
|
||||
# add tests using piping
|
||||
|
||||
|
|
Loading…
Reference in a new issue