#!/bin/bash

# Copyright (C) 2016, 2017, 2018, 2019  Stefan Vargyas
# 
# This file is part of Json-Type.
# 
# Json-Type is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# Json-Type is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with Json-Type.  If not, see <http://www.gnu.org/licenses/>.

#
# File generated by a command like:
# $ json-gentest -C type-checker:dict6
#

[[ "$1" =~ ^-u[0-9]+$ ]] &&
u="${1:2}" ||
u=""

diff -u$u -L dict6.old <(echo \
'$ export JSON_TYPE_CHECK_ERROR_COMPLETE_TYPES=yes
$ json() { LD_LIBRARY_PATH=../lib ../src/json --terse --verbose --literal-value "$@"; }
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\''
{"foo":null,"bar":null}
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\''
{"foo":false,"bar":null}
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\''
{"foo":true,"bar":null}
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\''
{"foo":123,"bar":null}
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\''
{"foo":"foo","bar":null}
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\''
{"foo":{},"bar":null}
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\''
{"foo":[],"bar":null}
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\''
{"foo":null,"bar":null}
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"null"'\''
json: error: <stdin>:1:8: {"foo":false,"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"null"'\''
json: error: <stdin>:1:8: {"foo":true,"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"null"'\''
json: error: <stdin>:1:8: {"foo":123,"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"null"'\''
json: error: <stdin>:1:8: {"foo":"foo","bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"null"'\''
json: error: <stdin>:1:8: {"foo":{},"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"null"'\''
json: error: <stdin>:1:8: {"foo":[],"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"boolean"'\''
json: error: <stdin>:1:8: {"foo":null,"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\''
{"foo":false,"bar":null}
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\''
{"foo":true,"bar":null}
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"boolean"'\''
json: error: <stdin>:1:8: {"foo":123,"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"boolean"'\''
json: error: <stdin>:1:8: {"foo":"foo","bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"boolean"'\''
json: error: <stdin>:1:8: {"foo":{},"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"boolean"'\''
json: error: <stdin>:1:8: {"foo":[],"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"number"'\''
json: error: <stdin>:1:8: {"foo":null,"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"number"'\''
json: error: <stdin>:1:8: {"foo":false,"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"number"'\''
json: error: <stdin>:1:8: {"foo":true,"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\''
{"foo":123,"bar":null}
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"number"'\''
json: error: <stdin>:1:8: {"foo":"foo","bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"number"'\''
json: error: <stdin>:1:8: {"foo":{},"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"number"'\''
json: error: <stdin>:1:8: {"foo":[],"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"string"'\''
json: error: <stdin>:1:8: {"foo":null,"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"string"'\''
json: error: <stdin>:1:8: {"foo":false,"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"string"'\''
json: error: <stdin>:1:8: {"foo":true,"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"string"'\''
json: error: <stdin>:1:8: {"foo":123,"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\''
{"foo":"foo","bar":null}
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"string"'\''
json: error: <stdin>:1:8: {"foo":{},"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"string"'\''
json: error: <stdin>:1:8: {"foo":[],"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"object"'\''
json: error: <stdin>:1:8: {"foo":null,"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"object"'\''
json: error: <stdin>:1:8: {"foo":false,"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"object"'\''
json: error: <stdin>:1:8: {"foo":true,"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"object"'\''
json: error: <stdin>:1:8: {"foo":123,"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"object"'\''
json: error: <stdin>:1:8: {"foo":"foo","bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\''
{"foo":{},"bar":null}
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"object"'\''
json: error: <stdin>:1:8: {"foo":[],"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"array"'\''
json: error: <stdin>:1:8: {"foo":null,"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"array"'\''
json: error: <stdin>:1:8: {"foo":false,"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"array"'\''
json: error: <stdin>:1:8: {"foo":true,"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"array"'\''
json: error: <stdin>:1:8: {"foo":123,"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"array"'\''
json: error: <stdin>:1:8: {"foo":"foo","bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\''
json: error: <stdin>:1:8: type check error: type mismatch: expected a value of type `"array"'\''
json: error: <stdin>:1:8: {"foo":{},"bar":null}
json: error: <stdin>:1:8:        ^
{"foo":
command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\''
$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\''
{"foo":[],"bar":null}'
) -L dict6.new <(
echo '$ export JSON_TYPE_CHECK_ERROR_COMPLETE_TYPES=yes'
export JSON_TYPE_CHECK_ERROR_COMPLETE_TYPES=yes 2>&1 ||
echo 'command failed: export JSON_TYPE_CHECK_ERROR_COMPLETE_TYPES=yes'

echo '$ json() { LD_LIBRARY_PATH=../lib ../src/json --terse --verbose --literal-value "$@"; }'
json() { LD_LIBRARY_PATH=../lib ../src/json --terse --verbose --literal-value "$@"; } 2>&1 ||
echo 'command failed: json() { LD_LIBRARY_PATH=../lib ../src/json --terse --verbose --literal-value "$@"; }'

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}' <<< '{"foo":null,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}' <<< '{"foo":false,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}' <<< '{"foo":true,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}' <<< '{"foo":123,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}' <<< '{"foo":"foo","bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}' <<< '{"foo":{},"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}' <<< '{"foo":[],"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"type"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}' <<< '{"foo":null,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}' <<< '{"foo":false,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}' <<< '{"foo":true,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}' <<< '{"foo":123,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}' <<< '{"foo":"foo","bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}' <<< '{"foo":{},"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}' <<< '{"foo":[],"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"null"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}' <<< '{"foo":null,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}' <<< '{"foo":false,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}' <<< '{"foo":true,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}' <<< '{"foo":123,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}' <<< '{"foo":"foo","bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}' <<< '{"foo":{},"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}' <<< '{"foo":[],"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"boolean"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}' <<< '{"foo":null,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}' <<< '{"foo":false,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}' <<< '{"foo":true,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}' <<< '{"foo":123,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}' <<< '{"foo":"foo","bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}' <<< '{"foo":{},"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}' <<< '{"foo":[],"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"number"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}' <<< '{"foo":null,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}' <<< '{"foo":false,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}' <<< '{"foo":true,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}' <<< '{"foo":123,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}' <<< '{"foo":"foo","bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}' <<< '{"foo":{},"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}' <<< '{"foo":[],"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"string"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}' <<< '{"foo":null,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}' <<< '{"foo":false,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}' <<< '{"foo":true,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}' <<< '{"foo":123,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}' <<< '{"foo":"foo","bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}' <<< '{"foo":{},"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}' <<< '{"foo":[],"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"object"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}' <<< '{"foo":null,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":null,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}' <<< '{"foo":false,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":false,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}' <<< '{"foo":true,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":true,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}' <<< '{"foo":123,"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":123,"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}' <<< '{"foo":"foo","bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":"foo","bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}' <<< '{"foo":{},"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":{},"bar":null}'\'''

echo '$ json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\'''
json -d '{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}' <<< '{"foo":[],"bar":null}' 2>&1 ||
echo 'command failed: json -d '\''{"type":"dict","args":[{"name":"foo","type":"array"},{"name":"bar","type":"null"}]}'\'' <<< '\''{"foo":[],"bar":null}'\'''
)

