We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a3ded45 + bc41d4e commit 5d9803dCopy full SHA for 5d9803d
varint_test.go
@@ -34,6 +34,35 @@ func TestVarintSize(t *testing.T) {
34
}
35
36
37
+func TestOverflow_9thSignalsMore(t *testing.T) {
38
+ buf := bytes.NewBuffer([]byte{
39
+ 0xff, 0xff, 0xff, 0xff,
40
41
+ 0x80,
42
+ })
43
+
44
+ _, err := ReadUvarint(buf)
45
+ if err != ErrOverflow {
46
+ t.Fatalf("expected ErrOverflow, got: %s", err)
47
+ }
48
+}
49
50
+func TestOverflow_ReadBuffer(t *testing.T) {
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
func TestOverflow(t *testing.T) {
67
i, n, err := FromUvarint(
68
[]byte{
0 commit comments