[libvirt] [PATCH v2 4/4] tests: virjson: Test string escaping

Peter Krempa pkrempa at redhat.com
Wed Jul 19 13:18:44 UTC 2017


On Wed, Jul 19, 2017 at 09:08:16 -0400, John Ferlan wrote:
> 
> 
> On 07/11/2017 08:56 AM, Peter Krempa wrote:
> > Make sure that JSON strings can contain characters which need to be
> > escaped (double quotes, backslashes, tabs, etc.) and that JSON objects
> > formatted into strings can be nested into strings.
> > ---
> >  tests/virjsontest.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 66 insertions(+)
> > 
> 
> Seems there should be two separate patches here, one that ensures
> escaped strings work for DO_TEST_PARSE and the other passing/using a

Okay I'll split it and resend.

> nested string obj. Is "EscapeObj" even a right name, seems like
> "NestedObj" would be more appropriate. Is there some sort of escaping in
> the strings that I'm missing?

The naming issue is somewhere between those two, since you can nest JSON
naturally, but nesting a json string in a json value is what we are
tesing here.

> 
> Also, w/r/t escaping do we need handle double commas ",," that are
> supposed to turn into "," ?

Commas? Aren't you confusing this with escaping for qemu? JSON escaping
rules don't have anything special for commas since the escaping needs
to be done only if you want to store a JSON string into another JSON
string. Commas are not interpreted inside of strings.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170719/404bd8f0/attachment-0001.sig>


More information about the libvir-list mailing list