FIX: Adapt test for OS X.

POSIX sed doesn't understand the \w atom; use [A-Z] instead; it's also more precise.
This commit is contained in:
Ingo Karkat
2012-05-11 09:05:44 +02:00
parent 7acb521190
commit c0c93c8c0c

View File

@@ -11,21 +11,21 @@ This test covers the help output.
# Note: To avoid having to adapt the test whenever the help documentation # Note: To avoid having to adapt the test whenever the help documentation
# slightly changes, only check for the section headers. # slightly changes, only check for the section headers.
test_todo_session 'help output' <<EOF test_todo_session 'help output' <<EOF
>>> todo.sh help | sed '/^ \w/!d' >>> todo.sh help | sed '/^ [A-Z]/!d'
Usage: todo.sh [-fhpantvV] [-d todo_config] action [task_number] [task_description] Usage: todo.sh [-fhpantvV] [-d todo_config] action [task_number] [task_description]
Options: Options:
Built-in Actions: Built-in Actions:
EOF EOF
test_todo_session 'verbose help output' <<EOF test_todo_session 'verbose help output' <<EOF
>>> todo.sh -v help | sed '/^ \w/!d' >>> todo.sh -v help | sed '/^ [A-Z]/!d'
Usage: todo.sh [-fhpantvV] [-d todo_config] action [task_number] [task_description] Usage: todo.sh [-fhpantvV] [-d todo_config] action [task_number] [task_description]
Options: Options:
Built-in Actions: Built-in Actions:
EOF EOF
test_todo_session 'very verbose help output' <<EOF test_todo_session 'very verbose help output' <<EOF
>>> todo.sh -vv help | sed '/^ \w/!d' >>> todo.sh -vv help | sed '/^ [A-Z]/!d'
Usage: todo.sh [-fhpantvV] [-d todo_config] action [task_number] [task_description] Usage: todo.sh [-fhpantvV] [-d todo_config] action [task_number] [task_description]
Options: Options:
Environment variables: Environment variables:
@@ -34,7 +34,7 @@ EOF
make_action "foo" make_action "foo"
test_todo_session 'help output with custom action' <<EOF test_todo_session 'help output with custom action' <<EOF
>>> todo.sh -v help | sed '/^ \w/!d' >>> todo.sh -v help | sed '/^ [A-Z]/!d'
Usage: todo.sh [-fhpantvV] [-d todo_config] action [task_number] [task_description] Usage: todo.sh [-fhpantvV] [-d todo_config] action [task_number] [task_description]
Options: Options:
Built-in Actions: Built-in Actions: