File: decode_test.go

package info (click to toggle)
golang-github-segmentio-encoding 0.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 14,468 kB
  • sloc: makefile: 286
file content (19 lines) | stat: -rw-r--r-- 351 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package thrift_test

import (
	"bytes"
	"io"
	"testing"

	"github.com/segmentio/encoding/thrift"
)

func TestDecodeEOF(t *testing.T) {
	p := thrift.CompactProtocol{}
	d := thrift.NewDecoder(p.NewReader(bytes.NewReader(nil)))
	v := struct{ Name string }{}

	if err := d.Decode(&v); err != io.EOF {
		t.Errorf("unexpected error returned: %v", err)
	}
}