add unit test for dealing with borked json

Signed-off-by: Sietse van der Molen <sietse@vdmolen.eu>