diff options
Diffstat (limited to 'tests/cram/test_jshn.t')
-rw-r--r-- | tests/cram/test_jshn.t | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/cram/test_jshn.t b/tests/cram/test_jshn.t new file mode 100644 index 0000000..d228f0e --- /dev/null +++ b/tests/cram/test_jshn.t @@ -0,0 +1,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; |