test_jshn.t 513 B

12345678910111213141516171819202122232425
  1. set jshn for convenience:
  2. $ [ -n "$JSHN" ] && export PATH="$(dirname "$JSHN"):$PATH"
  3. $ alias jshn="valgrind --quiet --leak-check=full jshn"
  4. check usage:
  5. $ jshn
  6. Usage: jshn [-n] [-i] -r <message>|-R <file>|-o <file>|-p <prefix>|-w
  7. [2]
  8. test bad json:
  9. $ jshn -r '[]'
  10. Failed to parse message data
  11. [1]
  12. test good json:
  13. $ jshn -r '{"foo": "bar", "baz": {"next": "meep"}}'
  14. json_init;
  15. json_add_string 'foo' 'bar';
  16. json_add_object 'baz';
  17. json_add_string 'next' 'meep';
  18. json_close_object;