Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/rs/tests/rs_test.sh
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | |||||
atf_test_case k_flag | atf_test_case k_flag | ||||
k_flag_head() | k_flag_head() | ||||
{ | { | ||||
atf_set "descr" "Verify the usage of option 'k'" | atf_set "descr" "Verify the usage of option 'k'" | ||||
} | } | ||||
k_flag_body() | k_flag_body() | ||||
{ | { | ||||
atf_check -s exit:0 -o empty rs -k < /dev/null | atf_check -s exit:0 -o empty rs -k 1 < /dev/null | ||||
emaste: these ones were actually buggy tests before? | |||||
Done Inline ActionsYes. These should have been failing with an error due to missing a required argument. jhb: Yes. These should have been failing with an error due to missing a required argument. | |||||
} | } | ||||
atf_test_case K_flag | atf_test_case K_flag | ||||
K_flag_head() | K_flag_head() | ||||
{ | { | ||||
atf_set "descr" "Verify the usage of option 'K'" | atf_set "descr" "Verify the usage of option 'K'" | ||||
} | } | ||||
K_flag_body() | K_flag_body() | ||||
{ | { | ||||
atf_check -s exit:0 -o inline:" | atf_check -s exit:0 -o inline:" | ||||
" rs -K < /dev/null | " rs -K 1 < /dev/null | ||||
} | } | ||||
atf_test_case g_flag | atf_test_case g_flag | ||||
g_flag_head() | g_flag_head() | ||||
{ | { | ||||
atf_set "descr" "Verify the usage of option 'g'" | atf_set "descr" "Verify the usage of option 'g'" | ||||
} | } | ||||
g_flag_body() | g_flag_body() | ||||
{ | { | ||||
atf_check -s exit:0 -o empty rs -g < /dev/null | atf_check -s exit:0 -o empty rs -g 1 < /dev/null | ||||
} | } | ||||
atf_test_case G_flag | atf_test_case G_flag | ||||
G_flag_head() | G_flag_head() | ||||
{ | { | ||||
atf_set "descr" "Verify the usage of option 'G'" | atf_set "descr" "Verify the usage of option 'G'" | ||||
} | } | ||||
G_flag_body() | G_flag_body() | ||||
{ | { | ||||
atf_check -s exit:0 -o empty rs -G < /dev/null | atf_check -s exit:0 -o empty rs -G 10 < /dev/null | ||||
} | } | ||||
atf_test_case e_flag | atf_test_case e_flag | ||||
e_flag_head() | e_flag_head() | ||||
{ | { | ||||
atf_set "descr" "Verify the usage of option 'e'" | atf_set "descr" "Verify the usage of option 'e'" | ||||
} | } | ||||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | |||||
atf_test_case invalid_usage | atf_test_case invalid_usage | ||||
invalid_usage_head() | invalid_usage_head() | ||||
{ | { | ||||
atf_set "descr" "Verify that an invalid usage with a supported option produces a valid error message" | atf_set "descr" "Verify that an invalid usage with a supported option produces a valid error message" | ||||
} | } | ||||
invalid_usage_body() | invalid_usage_body() | ||||
{ | { | ||||
atf_check -s not-exit:0 -e inline:"rs: width must be a positive integer | atf_check -s not-exit:0 -e inline:"rs: option requires an argument -- w | ||||
usage: rs [-[csCS][x][kKgGw][N]tTeEnyjhHmz] [rows [cols]] | |||||
" rs -w | " rs -w | ||||
} | } | ||||
atf_test_case no_arguments | atf_test_case no_arguments | ||||
no_arguments_head() | no_arguments_head() | ||||
{ | { | ||||
atf_set "descr" "Verify that rs(1) executes successfully and produces a valid output when invoked without any arguments" | atf_set "descr" "Verify that rs(1) executes successfully and produces a valid output when invoked without any arguments" | ||||
} | } | ||||
Show All 30 Lines |
these ones were actually buggy tests before?