]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virjsontest: Introduce a test case for an empty array
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 24 Aug 2023 07:56:25 +0000 (09:56 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 24 Aug 2023 11:47:41 +0000 (13:47 +0200)
Previous commits were all about empty strings and empty JSON
arrays. Introduce a test case for "[]" to make sure we pare it
correctly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
tests/virjsontest.c

index 294889a795640a528b58e9c35f5f8ec728fd6529..6b6a64d3d3bcbb7a0694599ccad53ecb67957971 100644 (file)
@@ -553,6 +553,7 @@ mymain(void)
     DO_TEST_PARSE("integer", "1", NULL);
     DO_TEST_PARSE("boolean", "true", NULL);
     DO_TEST_PARSE("null", "null", NULL);
+    DO_TEST_PARSE("[]", "[]", NULL);
 
     DO_TEST_PARSE("escaping symbols", "[\"\\\"\\t\\n\\\\\"]", NULL);
     DO_TEST_PARSE("escaped strings", "[\"{\\\"blurb\\\":\\\"test\\\"}\"]", NULL);