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 
  17 DIR=$(dirname $(whence $0))
  18 . ${DIR}/json_common
  19 
  20 BASELINE="$(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 }
  35 EOF)"
  36 
  37 OUTPUT="$(${DIR}/../../bin/print_json <<'EOF'
  38 add_boolean_array "boolean_array";
  39 
  40 add_byte_array "byte_array";
  41 
  42 add_uint8_array "uint8_array";
  43 add_uint16_array "uint16_array";
  44 add_uint32_array "uint32_array";
  45 add_uint64_array "uint64_array";
  46 
  47 add_int8_array "int8_array";
  48 add_int16_array "int16_array";
  49 add_int32_array "int32_array";
  50 add_int64_array "int64_array";
  51 
  52 add_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  */
  59 add_object_array "object_array";
  60 end;
  61 EOF)"
  62 
  63 complete