mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-27 05:15:47 +00:00
add base and bitsize to bad tests
This commit is contained in:
@@ -166,18 +166,31 @@ func TestBadUintParse(t *testing.T) {
|
|||||||
processor processor.Processor
|
processor processor.Processor
|
||||||
name string
|
name string
|
||||||
payload any
|
payload any
|
||||||
|
base int
|
||||||
|
bitSize int
|
||||||
errorString string
|
errorString string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "non-string input",
|
name: "non-string input",
|
||||||
payload: []byte{0x01},
|
payload: []byte{0x01},
|
||||||
|
base: 10,
|
||||||
|
bitSize: 64,
|
||||||
errorString: "uint.parse processor only accepts a string",
|
errorString: "uint.parse processor only accepts a string",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "not uint string",
|
name: "not uint string",
|
||||||
payload: "-1234",
|
payload: "-1234",
|
||||||
|
base: 10,
|
||||||
|
bitSize: 64,
|
||||||
errorString: "strconv.ParseUint: parsing \"-1234\": invalid syntax",
|
errorString: "strconv.ParseUint: parsing \"-1234\": invalid syntax",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "bit overflow",
|
||||||
|
payload: "123456789012345678901234567",
|
||||||
|
base: 10,
|
||||||
|
bitSize: 32,
|
||||||
|
errorString: "strconv.ParseUint: parsing \"123456789012345678901234567\": value out of range",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
|||||||
Reference in New Issue
Block a user