#!/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-cases:18
#

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

diff -u$u -L 18.old <(echo \
'$ json() { set -o pipefail && LD_LIBRARY_PATH=../lib ../src/json --terse --verbose --literal-value "$@" 2>&1|sed -r '\''/error:/s|(/dev/fd/)[0-9]+|\1??|'\''; }
$ json -d '\''{"type":"list","args":["number"]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"number"'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["number"]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":[{"plain":0}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `{"plain":0}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":[{"plain":0}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":[{"type":"object","args":[]}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `{"type":"object",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":[{"type":"object","args":[]}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":[{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `{"type":"array",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":[{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["number","string"]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"number"'\'' or `"string"'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["number","string"]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":[{"plain":0},{"plain":""}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `{"plain":0}'\'' or `{"plain":""}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":[{"plain":0},{"plain":""}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":[{"type":"object","args":[]},{"type":"object","args":[{"name":"foo","type":"type"}]}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `{"type":"object",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":[{"type":"object","args":[]},{"type":"object","args":[{"name":"foo","type":"type"}]}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":[{"type":"array","args":"null"},{"type":"array","args":"string"}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `{"type":"array",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":[{"type":"array","args":"null"},{"type":"array","args":"string"}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["number",{"type":"object","args":[]}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"number"'\'' or `{"type":"object",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["number",{"type":"object","args":[]}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":[{"plain":0},{"type":"object","args":[]}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `{"plain":0}'\'' or `{"type":"object",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":[{"plain":0},{"type":"object","args":[]}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["object",{"type":"object","args":[]}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"object"'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["object",{"type":"object","args":[]}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["array",{"type":"object","args":[]}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"array"'\'' or `{"type":"object",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["array",{"type":"object","args":[]}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["number",{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"number"'\'' or `{"type":"array",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["number",{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":[{"plain":0},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `{"plain":0}'\'' or `{"type":"array",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":[{"plain":0},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["object",{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"object"'\'' or `{"type":"array",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["object",{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["array",{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"array"'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["array",{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["number","string",{"type":"object","args":[]}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"number"'\'', `"string"'\'' or `{"type":"object",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["number","string",{"type":"object","args":[]}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["number","object",{"type":"object","args":[]}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"number"'\'' or `"object"'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["number","object",{"type":"object","args":[]}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["number",{"plain":""},{"type":"object","args":[]}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"number"'\'', `{"plain":""}'\'' or `{"type":"object",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["number",{"plain":""},{"type":"object","args":[]}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["number",{"plain":0},{"type":"object","args":[]}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"number"'\'' or `{"type":"object",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["number",{"plain":0},{"type":"object","args":[]}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["number","array",{"type":"object","args":[]}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"number"'\'', `"array"'\'' or `{"type":"object",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["number","array",{"type":"object","args":[]}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["number","string",{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"number"'\'', `"string"'\'' or `{"type":"array",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["number","string",{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["number",{"plain":""},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"number"'\'', `{"plain":""}'\'' or `{"type":"array",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["number",{"plain":""},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["number",{"plain":0},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"number"'\'' or `{"type":"array",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["number",{"plain":0},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["number","object",{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"number"'\'', `"object"'\'' or `{"type":"array",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["number","object",{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["number","array",{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"number"'\'' or `"array"'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["number","array",{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["number",{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"number"'\'', `{"type":"object",...}'\'' or `{"type":"array",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["number",{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":[{"plain":0},{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `{"plain":0}'\'', `{"type":"object",...}'\'' or `{"type":"array",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":[{"plain":0},{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["object",{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"object"'\'' or `{"type":"array",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["object",{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["array",{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"array"'\'' or `{"type":"object",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["array",{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["number","string",{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"number"'\'', `"string"'\'', `{"type":"object",...}'\'' or `{"type":"array",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["number","string",{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["number",{"plain":""},{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"number"'\'', `{"plain":""}'\'', `{"type":"object",...}'\'' or `{"type":"array",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["number",{"plain":""},{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["number",{"plain":0},{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"number"'\'', `{"type":"object",...}'\'' or `{"type":"array",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["number",{"plain":0},{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["number","object",{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"number"'\'', `"object"'\'' or `{"type":"array",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["number","object",{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
$ json -d '\''{"type":"list","args":["number","array",{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\''
json: error: <stdin>:1:1: type check error: type mismatch: expected a value of type `"number"'\'', `"array"'\'' or `{"type":"object",...}'\''
json: error: <stdin>:1:1: false
json: error: <stdin>:1:1: ^
command failed: json -d '\''{"type":"list","args":["number","array",{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''
) -L 18.new <(
echo '$ json() { set -o pipefail && LD_LIBRARY_PATH=../lib ../src/json --terse --verbose --literal-value "$@" 2>&1|sed -r '\''/error:/s|(/dev/fd/)[0-9]+|\1??|'\''; }'
json() { set -o pipefail && LD_LIBRARY_PATH=../lib ../src/json --terse --verbose --literal-value "$@" 2>&1|sed -r '/error:/s|(/dev/fd/)[0-9]+|\1??|'; } 2>&1 ||
echo 'command failed: json() { set -o pipefail && LD_LIBRARY_PATH=../lib ../src/json --terse --verbose --literal-value "$@" 2>&1|sed -r '\''/error:/s|(/dev/fd/)[0-9]+|\1??|'\''; }'

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

echo '$ json -d '\''{"type":"list","args":[{"plain":0}]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":[{"plain":0}]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":[{"plain":0}]}'\'' <<< '\''false'\'''

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

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

echo '$ json -d '\''{"type":"list","args":["number","string"]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":["number","string"]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":["number","string"]}'\'' <<< '\''false'\'''

echo '$ json -d '\''{"type":"list","args":[{"plain":0},{"plain":""}]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":[{"plain":0},{"plain":""}]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":[{"plain":0},{"plain":""}]}'\'' <<< '\''false'\'''

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

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

echo '$ json -d '\''{"type":"list","args":["number",{"type":"object","args":[]}]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":["number",{"type":"object","args":[]}]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":["number",{"type":"object","args":[]}]}'\'' <<< '\''false'\'''

echo '$ json -d '\''{"type":"list","args":[{"plain":0},{"type":"object","args":[]}]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":[{"plain":0},{"type":"object","args":[]}]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":[{"plain":0},{"type":"object","args":[]}]}'\'' <<< '\''false'\'''

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

echo '$ json -d '\''{"type":"list","args":["array",{"type":"object","args":[]}]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":["array",{"type":"object","args":[]}]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":["array",{"type":"object","args":[]}]}'\'' <<< '\''false'\'''

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

echo '$ json -d '\''{"type":"list","args":[{"plain":0},{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":[{"plain":0},{"type":"array","args":"null"}]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":[{"plain":0},{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''

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

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

echo '$ json -d '\''{"type":"list","args":["number","string",{"type":"object","args":[]}]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":["number","string",{"type":"object","args":[]}]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":["number","string",{"type":"object","args":[]}]}'\'' <<< '\''false'\'''

echo '$ json -d '\''{"type":"list","args":["number","object",{"type":"object","args":[]}]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":["number","object",{"type":"object","args":[]}]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":["number","object",{"type":"object","args":[]}]}'\'' <<< '\''false'\'''

echo '$ json -d '\''{"type":"list","args":["number",{"plain":""},{"type":"object","args":[]}]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":["number",{"plain":""},{"type":"object","args":[]}]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":["number",{"plain":""},{"type":"object","args":[]}]}'\'' <<< '\''false'\'''

echo '$ json -d '\''{"type":"list","args":["number",{"plain":0},{"type":"object","args":[]}]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":["number",{"plain":0},{"type":"object","args":[]}]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":["number",{"plain":0},{"type":"object","args":[]}]}'\'' <<< '\''false'\'''

echo '$ json -d '\''{"type":"list","args":["number","array",{"type":"object","args":[]}]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":["number","array",{"type":"object","args":[]}]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":["number","array",{"type":"object","args":[]}]}'\'' <<< '\''false'\'''

echo '$ json -d '\''{"type":"list","args":["number","string",{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":["number","string",{"type":"array","args":"null"}]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":["number","string",{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''

echo '$ json -d '\''{"type":"list","args":["number",{"plain":""},{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":["number",{"plain":""},{"type":"array","args":"null"}]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":["number",{"plain":""},{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''

echo '$ json -d '\''{"type":"list","args":["number",{"plain":0},{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":["number",{"plain":0},{"type":"array","args":"null"}]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":["number",{"plain":0},{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''

echo '$ json -d '\''{"type":"list","args":["number","object",{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":["number","object",{"type":"array","args":"null"}]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":["number","object",{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''

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

echo '$ json -d '\''{"type":"list","args":["number",{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":["number",{"type":"object","args":[]},{"type":"array","args":"null"}]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":["number",{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''

echo '$ json -d '\''{"type":"list","args":[{"plain":0},{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":[{"plain":0},{"type":"object","args":[]},{"type":"array","args":"null"}]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":[{"plain":0},{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''

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

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

echo '$ json -d '\''{"type":"list","args":["number","string",{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":["number","string",{"type":"object","args":[]},{"type":"array","args":"null"}]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":["number","string",{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''

echo '$ json -d '\''{"type":"list","args":["number",{"plain":""},{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":["number",{"plain":""},{"type":"object","args":[]},{"type":"array","args":"null"}]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":["number",{"plain":""},{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''

echo '$ json -d '\''{"type":"list","args":["number",{"plain":0},{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":["number",{"plain":0},{"type":"object","args":[]},{"type":"array","args":"null"}]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":["number",{"plain":0},{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''

echo '$ json -d '\''{"type":"list","args":["number","object",{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":["number","object",{"type":"object","args":[]},{"type":"array","args":"null"}]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":["number","object",{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''

echo '$ json -d '\''{"type":"list","args":["number","array",{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''
json -d '{"type":"list","args":["number","array",{"type":"object","args":[]},{"type":"array","args":"null"}]}' <<< 'false' 2>&1 ||
echo 'command failed: json -d '\''{"type":"list","args":["number","array",{"type":"object","args":[]},{"type":"array","args":"null"}]}'\'' <<< '\''false'\'''
)

