From 7a571989f85c4c1d900edc448344ea91ceec392a Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 26 Jun 2017 23:34:07 -0500 Subject: [PATCH] Add yajl test for trailing commas in arrays and maps --- src/libCom/test/yajlTestCases.pm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/libCom/test/yajlTestCases.pm b/src/libCom/test/yajlTestCases.pm index 9064df043..40eaff6e7 100644 --- a/src/libCom/test/yajlTestCases.pm +++ b/src/libCom/test/yajlTestCases.pm @@ -3000,6 +3000,29 @@ sub cases { "memory leaks:\t0" ] }, + { + name => "trailing_commas", + opts => [], + input => [ + "{\"array\":[1,2,],\"map\":{\"a\":1,},}", + "" + ], + gives => [ + "map open '{'", + "key: 'array'", + "array open '['", + "integer: 1", + "integer: 2", + "array close ']'", + "key: 'map'", + "map open '{'", + "key: 'a'", + "integer: 1", + "map close '}'", + "map close '}'", + "memory leaks:\t0" + ] + }, { name => "true", opts => [],