Fix integer keys in inline tables (#239)

Fixes #224
This commit is contained in:
xiehuc
2018-09-23 02:02:51 +08:00
committed by Thomas Pelletier
parent 90d6f96e9e
commit 78b76feda6
2 changed files with 12 additions and 1 deletions
+11
View File
@@ -897,3 +897,14 @@ func TestInvalidFloatParsing(t *testing.T) {
t.Error("Bad error message:", err.Error())
}
}
func TestMapKeyIsNum(t *testing.T) {
_, err := Load("table={2018=1,2019=2}")
if err != nil {
t.Error("should be passed")
}
_, err = Load(`table={"2018"=1,"2019"=2}`)
if err != nil {
t.Error("should be passed")
}
}