test/system: Test the handling of unknown flags

https://github.com/containers/toolbox/pull/802
This commit is contained in:
Debarshi Ray 2021-06-22 18:51:13 +02:00
parent f2efc0f758
commit 9fdf10f2e1

View file

@ -33,3 +33,11 @@ load 'libs/helpers.bash'
assert_line --index 0 "Error: unknown command \"foo\" for \"toolbox\""
assert_line --index 1 "Run 'toolbox --help' for usage."
}
@test "help: Try to run toolbox with non-existent flag (shows usage screen)" {
run $TOOLBOX --foo
assert_failure
assert_line --index 0 "Error: unknown flag: --foo"
assert_line --index 1 "Run 'toolbox --help' for usage."
}