aboutsummaryrefslogtreecommitdiff
path: root/format/pktline/decoder_unexpected_eof_test.go
blob: f35fd8a7bf34ece1745b5ddaea9793b5d02ccc82 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package pktline_test

import (
	"errors"
	"io"
	"strings"
	"testing"
	"codeberg.org/lindenii/furgit/format/pktline"
)

func TestDecoderUnexpectedEOF(t *testing.T) {
	t.Parallel()

	dec := pktline.NewDecoder(strings.NewReader("0006a"), pktline.ReadOptions{})

	_, err := dec.ReadFrame()
	if !errors.Is(err, io.ErrUnexpectedEOF) {
		t.Fatalf("got err %v, want io.ErrUnexpectedEOF", err)
	}
}