xref: /illumos-gate/usr/src/test/util-tests/tests/libnvpair_json/json_03_empty_arrays.ksh (revision 797f979d1fe26bfb1cdeb3e7a86ed24c0b654200)
1#!/bin/ksh
2#
3# This file and its contents are supplied under the terms of the
4# Common Development and Distribution License ("CDDL"), version 1.0.
5# You may only use this file in accordance with the terms of version
6# 1.0 of the CDDL.
7#
8# A full copy of the text of the CDDL should have accompanied this
9# source.  A copy of the CDDL is also available via the Internet at
10# http://www.illumos.org/license/CDDL.
11#
12
13#
14# Copyright (c) 2014, Joyent, Inc.
15#
16
17DIR=$(dirname $(whence $0))
18. ${DIR}/json_common
19
20BASELINE="$(cat <<EOF
21{\
22"boolean_array":[],\
23"byte_array":[],\
24"uint8_array":[],\
25"uint16_array":[],\
26"uint32_array":[],\
27"uint64_array":[],\
28"int8_array":[],\
29"int16_array":[],\
30"int32_array":[],\
31"int64_array":[],\
32"string_array":[],\
33"object_array":[{}]\
34}
35EOF)"
36
37OUTPUT="$(${DIR}/../../bin/print_json <<'EOF'
38add_boolean_array "boolean_array";
39
40add_byte_array "byte_array";
41
42add_uint8_array "uint8_array";
43add_uint16_array "uint16_array";
44add_uint32_array "uint32_array";
45add_uint64_array "uint64_array";
46
47add_int8_array "int8_array";
48add_int16_array "int16_array";
49add_int32_array "int32_array";
50add_int64_array "int64_array";
51
52add_string_array "string_array";
53
54/*
55 * The testing DSL does not presently support the generation of a completely
56 * empty object array.  Thus, the following directive will produce an array
57 * with a single keyless object:
58 */
59add_object_array "object_array";
60end;
61EOF)"
62
63complete
64