(t *testing.T)
| 22 | } |
| 23 | |
| 24 | func TestEncode(t *testing.T) { |
| 25 | in := "\xab\xcd" |
| 26 | |
| 27 | got, err := ioutil.ReadAll(&encodeReader{strings.NewReader(in)}) |
| 28 | if err != nil { |
| 29 | t.Fatal(err) |
| 30 | } |
| 31 | |
| 32 | want := []byte("abcd") |
| 33 | if !bytes.Equal(got, want) { |
| 34 | t.Errorf("encodeReader(%q) = %q want %q", in, got, want) |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | func TestDecode(t *testing.T) { |
| 39 | in := "abcd" |