(t *testing.T)
| 102 | } |
| 103 | |
| 104 | func TestUnmarshalLog(t *testing.T) { |
| 105 | dumper := spew.ConfigState{DisableMethods: true, Indent: " "} |
| 106 | for name, test := range unmarshalLogTests { |
| 107 | var log *Log |
| 108 | err := json.Unmarshal([]byte(test.input), &log) |
| 109 | checkError(t, name, err, test.wantError) |
| 110 | if test.wantError == nil && err == nil { |
| 111 | if !reflect.DeepEqual(log, test.want) { |
| 112 | t.Errorf("test %q:\nGOT %sWANT %s", name, dumper.Sdump(log), dumper.Sdump(test.want)) |
| 113 | } |
| 114 | } |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | func checkError(t *testing.T, testname string, got, want error) bool { |
| 119 | if got == nil { |
nothing calls this directly
no test coverage detected