From bef97df805461bac48d8f8724715bbf046f7a759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D0=B5=D0=BC=D0=B8=D0=B9?= Date: Sat, 19 Jun 2021 14:00:53 +0300 Subject: [PATCH] prototype --- back_pwquality.sh | 4 ++++ test_common.sh | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) 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))"