(t *testing.T)
| 50 | } |
| 51 | |
| 52 | func TestEncodingError(t *testing.T) { |
| 53 | gobE := GobEncoding{} |
| 54 | // gob error test |
| 55 | err := gobE.Unmarshal([]byte("foo"), nil) |
| 56 | assert.Error(t, err) |
| 57 | |
| 58 | jsonE := JSONEncoding{} |
| 59 | // json error test |
| 60 | err = jsonE.Unmarshal([]byte("foo"), nil) |
| 61 | assert.Error(t, err) |
| 62 | |
| 63 | jsonDE := JSONGzipEncoding{} |
| 64 | // gzip error test |
| 65 | _, err = jsonDE.Marshal(make(chan string)) |
| 66 | assert.Error(t, err) |
| 67 | err = jsonDE.Unmarshal([]byte("foo"), nil) |
| 68 | assert.Error(t, err) |
| 69 | data, _ := GzipEncode([]byte("foo")) |
| 70 | err = jsonDE.Unmarshal(data, make(chan string)) |
| 71 | assert.Error(t, err) |
| 72 | _, err = GzipDecode(nil) |
| 73 | assert.Error(t, err) |
| 74 | |
| 75 | jsonSE := JSONSnappyEncoding{} |
| 76 | // snappy error test |
| 77 | _, err = jsonSE.Marshal(make(chan string)) |
| 78 | assert.Error(t, err) |
| 79 | err = jsonSE.Unmarshal([]byte("foo"), nil) |
| 80 | assert.Error(t, err) |
| 81 | |
| 82 | msgE := MsgPackEncoding{} |
| 83 | // pack error test |
| 84 | err = msgE.Unmarshal([]byte("foo"), nil) |
| 85 | assert.Error(t, err) |
| 86 | } |
| 87 | |
| 88 | type codec struct{} |
| 89 |
nothing calls this directly
no test coverage detected