28 lines
501 B
Plaintext
28 lines
501 B
Plaintext
|
#!/bin/sh
|
||
|
|
||
|
run_cut (){
|
||
|
echo "----- test: cut $@ -----"
|
||
|
cut "$@"
|
||
|
}
|
||
|
|
||
|
run_test_block (){
|
||
|
run_cut -f 1 "$@"
|
||
|
run_cut -f 2 "$@"
|
||
|
run_cut -f 3 "$@"
|
||
|
run_cut -f 1-2 "$@"
|
||
|
run_cut -f 2,3 "$@"
|
||
|
run_cut -f 4 "$@"
|
||
|
run_cut -f 1-3,4-7 "$@"
|
||
|
run_cut -f 1,2-7 "$@"
|
||
|
}
|
||
|
|
||
|
run_all_tests (){
|
||
|
run_test_block "$@"
|
||
|
run_test_block -s "$@"
|
||
|
run_test_block -d ':' "$@"
|
||
|
run_test_block -d ':' -s "$@"
|
||
|
}
|
||
|
|
||
|
run_all_tests $1/input | sed -e "s@$1/@@" > result
|
||
|
cmp -s result $1/expected
|