File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -386,12 +386,18 @@ has_key() {
386386
387387check_eq () {
388388 tput cuf 6
389- local type=$( jq -r -c --argjson a " $1 " -n ' $a|type' )
389+ local type=$( jq -r -c --argjson a " $1 " -n ' $a|type' 2> /dev/null )
390390 local check
391391 if [[ $type == " object" || $type == " array" ]]; then
392392 check=$( jq -c --argjson a " $1 " --argjson b " $2 " -n ' def post_recurse(f): def r: (f | select(. != null) | r), .; r; def post_recurse: post_recurse(.[]?); ($a | (post_recurse | arrays) |= sort) as $a | ($b | (post_recurse | arrays) |= sort) as $b | $a == $b' )
393- else
393+ elif [[ $type == " number " || $type == " boolean " || $type == " null " || $type == " string " ]] ; then
394394 check=$( jq -c --argjson a " $1 " --argjson b " $2 " -n ' $a == $b' )
395+ else
396+ if [[ $1 == $2 ]]; then
397+ check=" true"
398+ else
399+ check=" false"
400+ fi
395401 fi
396402 if [[ $check == " true" ]]; then
397403 echo " ${GREEN}${BOLD} Check Passed${RESET} "
You can’t perform that action at this time.
0 commit comments