MCPcopy Create free account
hub / github.com/CPChain/chain / TestUnmarshalLog

Function TestUnmarshalLog

types/log_test.go:104–116  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

102}
103
104func 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
118func checkError(t *testing.T, testname string, got, want error) bool {
119 if got == nil {

Callers

nothing calls this directly

Calls 1

checkErrorFunction · 0.70

Tested by

no test coverage detected