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

import (
	"errors"
	"strings"
	"testing"

	"codeberg.org/lindenii/furgit/format/pktline"
)

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

	dec := pktline.NewDecoder(strings.NewReader("0003"), pktline.ReadOptions{})
	_, err := dec.ReadFrame()

	if _, ok := errors.AsType[*pktline.ProtocolError](err); !ok {
		t.Fatalf("got err %v, want ProtocolError", err)
	}
}