Support underscores and uppercase letters in key names, as well as international characters (not specified in TOML spec, but implied by Unicode and JSON compatibility). Fixes #3.

This commit is contained in:
Alexander Staubo
2013-03-19 06:16:06 +01:00
parent 95c8a36e24
commit 4e227cb34e
2 changed files with 28 additions and 6 deletions
+21
View File
@@ -77,6 +77,27 @@ func TestBasicKey(t *testing.T) {
})
}
func TestBasicKeyWithUnderscore(t *testing.T) {
testFlow(t, "hello_hello", []token{
token{tokenKey, "hello_hello"},
token{tokenEOF, ""},
})
}
func TestBasicKeyWithUppercaseMix(t *testing.T) {
testFlow(t, "helloHELLOHello", []token{
token{tokenKey, "helloHELLOHello"},
token{tokenEOF, ""},
})
}
func TestBasicKeyWithInternationalCharacters(t *testing.T) {
testFlow(t, "héllÖ", []token{
token{tokenKey, "héllÖ"},
token{tokenEOF, ""},
})
}
func TestBasicKeyAndEqual(t *testing.T) {
testFlow(t, "hello =", []token{
token{tokenKey, "hello"},