diff options
author | Dr. David Alan Gilbert <dave@treblig.org> | 2017-03-05 01:25:18 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2017-03-11 15:48:42 +0000 |
commit | 799e1651b463bf127e6a99573e20331f6d7399b3 (patch) | |
tree | 647420d1bd668a4bb6aa57061057911a3520b26d /json-glib/tests/parser.c | |
parent | c7b7b18e39522d8718e1d5118fe34d9b1c9707a0 (diff) | |
download | json-glib-799e1651b463bf127e6a99573e20331f6d7399b3.tar.gz |
Allow empty string as object member name
Commit 028e540 disallowed empty member names in objects, however
they are unfortunately valid JSON. This patch reenables an empty
string as a member name.
Tests are updated to allow the empty string case, and to test
the use of an empty string in generation, iteration etc.
https://bugzilla.gnome.org/show_bug.cgi?id=747279
Diffstat (limited to 'json-glib/tests/parser.c')
-rw-r--r-- | json-glib/tests/parser.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/json-glib/tests/parser.c b/json-glib/tests/parser.c index bdfbf13..f71584a 100644 --- a/json-glib/tests/parser.c +++ b/json-glib/tests/parser.c @@ -96,7 +96,8 @@ static const struct { { "{ \"name\" : \"\", \"state\" : 1 }", 2, "name", JSON_NODE_VALUE, G_TYPE_STRING }, { "{ \"foo\" : \"bar\", \"baz\" : null }", 2, "baz", JSON_NODE_NULL, G_TYPE_INVALID }, { "{ \"channel\" : \"/meta/connect\" }", 1, "channel", JSON_NODE_VALUE, G_TYPE_STRING }, - { "{ \"halign\":0.5, \"valign\":0.5 }", 2, "valign", JSON_NODE_VALUE, G_TYPE_DOUBLE } + { "{ \"halign\":0.5, \"valign\":0.5 }", 2, "valign", JSON_NODE_VALUE, G_TYPE_DOUBLE }, + { "{ \"\" : \"emptiness\" }", 1, "", JSON_NODE_VALUE, G_TYPE_STRING } }; static const gchar *test_nested_objects[] = { |