Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: Add basic coverage of -h / shorthelp.
For a start, this is basically an adapted version of tests/t2100-help.sh.
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
# | ||
|
||
test_description='shorthelp functionality | ||
This test covers the output of the -h option and the shorthelp action. | ||
' | ||
. ./actions-test-lib.sh | ||
. ./test-lib.sh | ||
|
||
# Note: To avoid having to adapt the test whenever the actions change, only | ||
# check for the section headers. | ||
test_todo_session '-h output' <<EOF | ||
>>> todo.sh -h | sed '/^ [A-Z]/!d' | ||
Usage: todo.sh [-fhpantvV] [-d todo_config] action [task_number] [task_description] | ||
Actions: | ||
Actions can be added and overridden using scripts in the actions | ||
See "help" for more details. | ||
EOF | ||
|
||
test_todo_session 'shorthelp output' <<EOF | ||
>>> todo.sh shorthelp | sed '/^ [A-Z]/!d' | ||
Usage: todo.sh [-fhpantvV] [-d todo_config] action [task_number] [task_description] | ||
Actions: | ||
Actions can be added and overridden using scripts in the actions | ||
See "help" for more details. | ||
EOF | ||
|
||
make_action "foo" | ||
test_todo_session 'shorthelp output with custom action' <<EOF | ||
>>> todo.sh -v shorthelp | sed '/^ [A-Z]/!d' | ||
Usage: todo.sh [-fhpantvV] [-d todo_config] action [task_number] [task_description] | ||
Actions: | ||
Actions can be added and overridden using scripts in the actions | ||
Add-on Actions: | ||
See "help" for more details. | ||
EOF | ||
|
||
test_done |