diff --git a/exercises/practice/hamming/hamming.bats b/exercises/practice/hamming/hamming.bats index 4aacf9a3..d5c1713b 100644 --- a/exercises/practice/hamming/hamming.bats +++ b/exercises/practice/hamming/hamming.bats @@ -82,6 +82,13 @@ load bats-extra assert_output "Usage: hamming.sh " } +@test "invalid input (more than 2 arguments)" { + [[ $BATS_RUN_SKIPPED == "true" ]] || skip + run bash hamming.sh 'A' 'A' 'A' + assert_failure + assert_output "Usage: hamming.sh " +} + # Within [[...]] the == operator is a _pattern matching_ operator. # To test for string equality, the right-hand side must be # quoted to prevent interpretation as a glob-style pattern.