Skip to content

Commit

Permalink
Satisfy linter
Browse files Browse the repository at this point in the history
  • Loading branch information
poszu committed Apr 4, 2024
1 parent bf19315 commit f6a808e
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions encoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,14 @@ func uint32PtrTestCases() []compactTestCase[*uint32] {
{newInteger[uint32](maxUint8), []byte{1, 0b1111_1101, 0b0000_0011}},
{newInteger[uint32](maxUint16), []byte{1, 0b1111_1110, 0b1111_1111, 0b0000_0011, 0b0000_0000}},
{newInteger[uint32](maxUint30), []byte{1, 0b1111_1110, 0b1111_1111, 0b1111_1111, 0b1111_1111}},
{newInteger[uint32](math.MaxUint32), []byte{1, 0b0000_0011, 0b1111_1111, 0b1111_1111, 0b1111_1111, 0b1111_1111}},
{newInteger[uint32](math.MaxUint32), []byte{
1,
0b0000_0011,
0b1111_1111,
0b1111_1111,
0b1111_1111,
0b1111_1111,
}},
}
}

Expand All @@ -164,7 +171,14 @@ func uint64PtrTestCases() []compactTestCase[*uint64] {
{nil, []byte{0}},
{newInteger[uint64](maxUint8), []byte{1, 0b1111_1101, 0b0000_0011}},
{newInteger[uint64](maxUint16), []byte{1, 0b1111_1110, 0b1111_1111, 0b0000_0011, 0b0000_0000}},
{newInteger[uint64](math.MaxUint32), []byte{1, 0b0000_0011, 0b1111_1111, 0b1111_1111, 0b1111_1111, 0b1111_1111}},
{newInteger[uint64](math.MaxUint32), []byte{
1,
0b0000_0011,
0b1111_1111,
0b1111_1111,
0b1111_1111,
0b1111_1111,
}},
{newInteger[uint64](math.MaxUint64), []byte{
1,
0b0001_0011,
Expand All @@ -176,10 +190,10 @@ func uint64PtrTestCases() []compactTestCase[*uint64] {
0b1111_1111,
0b1111_1111,
0b1111_1111,
},
},
}},
}
}

func mustDecodeHex(hexStr string) []byte {
b, err := hex.DecodeString(hexStr)
if err != nil {
Expand Down

0 comments on commit f6a808e

Please sign in to comment.