(t *testing.T)
| 84 | } |
| 85 | |
| 86 | func TestReadN(t *testing.T) { |
| 87 | b := []byte{0x05, 0x11, 0x01, 0x16} |
| 88 | |
| 89 | r := NewReader(b) |
| 90 | i, err := r.Read(2) |
| 91 | if err != nil { |
| 92 | t.Error("unexpected error happened, got", err) |
| 93 | } |
| 94 | |
| 95 | if !reflect.DeepEqual(i, []byte{0x05, 0x11}) { |
| 96 | t.Error("expect read [5 17], got", i) |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | func TestReadCount(t *testing.T) { |
| 101 | b := make([]byte, 18) |