(t *testing.T)
| 36 | } |
| 37 | |
| 38 | func TestDecode(t *testing.T) { |
| 39 | in := "abcd" |
| 40 | |
| 41 | got, err := ioutil.ReadAll(&decodeReader{r: strings.NewReader(in)}) |
| 42 | if err != nil { |
| 43 | t.Fatal(err) |
| 44 | } |
| 45 | |
| 46 | want := []byte{0xab, 0xcd} |
| 47 | if !bytes.Equal(got, want) { |
| 48 | t.Errorf("decodeReader(%q) = %q want %q", in, got, want) |
| 49 | } |
| 50 | } |