mirror of
https://github.com/eth-p/bat-extras.git
synced 2026-09-10 07:16:25 -04:00
Improve tests
This commit is contained in:
parent
763d34d9c9
commit
fa8a3bb850
|
|
@ -79,6 +79,13 @@ display_test_summary() {
|
|||
# -----------------------------------------------------------------------------
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
test_types="$("$HERE/util/test-exec.sh" --supports)"
|
||||
if ! grep -F "$1" <<< "$test_types" &>/dev/null; then
|
||||
printc "%{RED}Unknown test type: %s%{CLEAR}\n" "$1"
|
||||
printc "%{RED}Supported types:%{CLEAR}\n%s\n" "$test_types"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
run_all_tests "$1"
|
||||
exit_status=$?
|
||||
display_test_summary
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
set -e
|
||||
"$TEST_RUNNER" batgrep "ca" file.txt
|
||||
"$TEST_RUNNER" batgrep "ca" link.txt
|
||||
|
||||
|
|
|
|||
|
|
@ -5,10 +5,3 @@ car
|
|||
frog
|
||||
fox
|
||||
────────────────────────────────────────────────────────────────────────────────
|
||||
────────────────────────────────────────────────────────────────────────────────
|
||||
cat
|
||||
dog
|
||||
car
|
||||
frog
|
||||
fox
|
||||
────────────────────────────────────────────────────────────────────────────────
|
||||
|
|
|
|||
3
test/tests/batgrep.symlink.sh
Normal file
3
test/tests/batgrep.symlink.sh
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
set -e
|
||||
"$TEST_RUNNER" batgrep "ca" link.txt
|
||||
|
||||
7
test/tests/batgrep.symlink.snapshot
Normal file
7
test/tests/batgrep.symlink.snapshot
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
────────────────────────────────────────────────────────────────────────────────
|
||||
cat
|
||||
dog
|
||||
car
|
||||
frog
|
||||
fox
|
||||
────────────────────────────────────────────────────────────────────────────────
|
||||
|
|
@ -80,6 +80,13 @@ case "$1" in
|
|||
fi
|
||||
};;
|
||||
|
||||
--supports) {
|
||||
echo "snapshot-generate"
|
||||
echo "snapshot-test"
|
||||
echo "consistency-test"
|
||||
exit 0
|
||||
};;
|
||||
|
||||
*) {
|
||||
printf "\x1B[31mUnknown subcommand.\x1B[0m\n"
|
||||
printf " - \x1B[33msnapshot-generate\x1B[0m -- generate new snapshots\n"
|
||||
|
|
|
|||
Loading…
Reference in a new issue