shared/json: make it possible to specify source name for strings too, add tests
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 17 Nov 2022 13:15:48 +0000 (14:15 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 1 Dec 2022 17:02:06 +0000 (18:02 +0100)
commitb0eeb945881b86f6740b84c055f0ad2be7a09ad1
tree5dcfff24a6a935ed6aa9ff390feed888a6c114ab
parent50f2c32cd5477bb42bf9a26e4aefd7230c2574c7
shared/json: make it possible to specify source name for strings too, add tests

The source would be set implicitly when parsing from a named file. But
it's useful to specify the source also for cases where we're parsing a
ready string. I noticed the lack of this API when trying to write tests,
but it seems generally useful to be specify a source name when parsing
things.
src/shared/json.c
src/shared/json.h
src/test/test-json.c