From a009c9ab2a4012f0b6a1531df3aa9f3a2c6f7a34 Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Fri, 25 Apr 2014 07:45:27 -0700 Subject: [PATCH] test bad json --- images_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/images_test.go b/images_test.go index 19d665e..f172faf 100644 --- a/images_test.go +++ b/images_test.go @@ -10,6 +10,14 @@ type RunTest struct { regexps []string } +func Test_BadJSON(t *testing.T) { + _, err := parseJSON([]byte(` "VirtualSize": 662553464, "Size": 662553464, "RepoTags": [ ":" ], "ParentId": "", "Id": "4c1208b690c68af3476b437e7bc2bcc460f062bda2094d2d8f21a7e70368d358", "Created": 1386114144 }]`)) + + if err == nil { + t.Error("invalid json did not cause an error") + } +} + func Test_Dot(t *testing.T) { allMatch := []string{ "(?s)digraph docker {.*}",