Allow numbers in keys parsing
This commit is contained in:
+10
-5
@@ -51,12 +51,10 @@ func TestSimpleKV(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
// NOTE: from the BurntSushi test suite
|
||||
// NOTE: this test is pure evil due to the embedded '.'
|
||||
func TestSpecialKV(t *testing.T) {
|
||||
tree, err := Load("~!@$^&*()_+-`1234567890[]\\|/?><.,;: = 1")
|
||||
func TestNumberInKey(t *testing.T) {
|
||||
tree, err := Load("hello2 = 42")
|
||||
assertTree(t, tree, err, map[string]interface{}{
|
||||
"~!@$^&*()_+-`1234567890[]\\|/?><.,;:": int64(1),
|
||||
"hello2": int64(42),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -109,6 +107,13 @@ func TestSimpleString(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestSpaceKey(t *testing.T) {
|
||||
tree, err := Load("\"a b\" = \"hello world\"")
|
||||
assertTree(t, tree, err, map[string]interface{}{
|
||||
"a b": "hello world",
|
||||
})
|
||||
}
|
||||
|
||||
func TestStringEscapables(t *testing.T) {
|
||||
tree, err := Load("a = \"a \\n b\"")
|
||||
assertTree(t, tree, err, map[string]interface{}{
|
||||
|
||||
Reference in New Issue
Block a user