github.com/kamalshkeir/kencoding@v0.0.2-0.20230409043843-44b609a0475a/thrift/decode_test.go (about)

     1  package thrift_test
     2  
     3  import (
     4  	"bytes"
     5  	"io"
     6  	"testing"
     7  
     8  	"github.com/kamalshkeir/kencoding/thrift"
     9  )
    10  
    11  func TestDecodeEOF(t *testing.T) {
    12  	p := thrift.CompactProtocol{}
    13  	d := thrift.NewDecoder(p.NewReader(bytes.NewReader(nil)))
    14  	v := struct{ Name string }{}
    15  
    16  	if err := d.Decode(&v); err != io.EOF {
    17  		t.Errorf("unexpected error returned: %v", err)
    18  	}
    19  }