Decode: ensure signed numbers don't start with an underscore (#698)

This commit is contained in:
Cameron Moore
2021-12-04 15:56:48 -06:00
committed by GitHub
parent f53bc740c1
commit 6cd86876b8
2 changed files with 16 additions and 3 deletions
+9 -1
View File
@@ -2306,9 +2306,17 @@ func TestUnmarshalDecodeErrors(t *testing.T) {
data: `flt8 = 224_617.445_991__228`,
},
{
desc: "float with double _",
desc: "float with double .",
data: `flt8 = 1..2`,
},
{
desc: "number with plus sign and leading underscore",
data: `a = +_0`,
},
{
desc: "number with negative sign and leading underscore",
data: `a = -_0`,
},
{
desc: "int with wrong base",
data: `a = 0f2`,