Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test_jshn.t « cram « tests - git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d228f0e648c653a4c373180ec77d77d8256071aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
set jshn for convenience:

  $ [ -n "$JSHN" ] && export PATH="$(dirname "$JSHN"):$PATH"
  $ alias jshn="valgrind --quiet --leak-check=full jshn"

check usage:

  $ jshn
  Usage: jshn [-n] [-i] -r <message>|-R <file>|-w
  [2]

test bad json:

  $ jshn -r '[]'
  Failed to parse message data
  [1]

test good json:

  $ jshn -r '{"foo": "bar", "baz": {"next": "meep"}}'
  json_init;
  json_add_string 'foo' 'bar';
  json_add_object 'baz';
  json_add_string 'next' 'meep';
  json_close_object;