diff --git a/back_pwquality.sh b/back_pwquality.sh index b52ad2c..a6d5d30 100644 --- a/back_pwquality.sh +++ b/back_pwquality.sh @@ -88,9 +88,13 @@ _mk_pwquality_conf() { shift ;; --usercheck) shift; + echo 1 _check_argument_is_number "$1" "--usercheck" + echo 2 [[ "$1" =~ (0|1) ]] || error $"The received parameters are not correct. Expected %s, received %s" $"0 or 1" "$1" + echo 3 usercheck="$1" + echo 4 shift ;; --usersubstr) shift; diff --git a/test_common.sh b/test_common.sh index ccbe2bf..019ab06 100644 --- a/test_common.sh +++ b/test_common.sh @@ -6,13 +6,13 @@ TESTING=1 . ./common.sh -_check_argument_is_number 123 "this" || failed="$((++failed))" +! _check_argument_is_number 123 "this" && failed="$((++failed))" _check_argument_is_number NotNumber "this" && failed="$((++failed))" -_check_argument_value 8 7 "this" || failed="$((++failed))" +! _check_argument_value 8 7 "this" && failed="$((++failed))" _check_argument_value 1 7 "this" && failed="$((++failed))" -_check_argument_is_string "Hello" "this" || failed="$((++failed))" +! _check_argument_is_string "Hello" "this" && failed="$((++failed))" _check_argument_is_string "Hello world" "this" && failed="$((++failed))"