- if(error.line != 1 || error.column != 2)
- fail("json_pack didn't get the error coordinates right!");
+ check_error("Unexpected end of format string", "<format>", 1, 2, 2);
+
+ /* garbage after format string */
+ if(json_pack_ex(&error, 0, "[i]a", 42))
+ fail("json_pack failed to catch garbage after format string");
+ check_error("Garbage after format string", "<format>", 1, 4, 4);
+
+ if(json_pack_ex(&error, 0, "ia", 42))
+ fail("json_pack failed to catch garbage after format string");
+ check_error("Garbage after format string", "<format>", 1, 2, 2);