35 lines
1.3 KiB
Go
35 lines
1.3 KiB
Go
package parser_test
|
|
|
|
// func TestEmptyInput(t *testing.T) {
|
|
// runStatesT(t, statesT{"empty string", "", "", ""})
|
|
// }
|
|
|
|
// func TestFullIncludesLineAndRowPosition(t *testing.T) {
|
|
// p := toml.Parse("# 12345 abcde\t\n\n\n# 67890\r\n# 12345\n +")
|
|
// _, err := parseItemsToArray(p)
|
|
// actual := err.Error()
|
|
// expected := "unexpected input (expected end of file) at line 6, column 3"
|
|
// if actual != expected {
|
|
// t.Errorf("Unexpected error message:\nexpected: %s\nactual: %s\n", expected, actual)
|
|
// }
|
|
// }
|
|
|
|
// func TestInvalidUTF8Data(t *testing.T) {
|
|
// runStatesTs(t, []statesT{
|
|
// {"bare key 1", "\xbc", "", "invalid UTF8 character in input (expected end of file)"},
|
|
// {"bare key 2", "key\xbc", "[key]", "invalid UTF8 character in input (expected a value assignment)"},
|
|
// {"start of value", "key=\xbc", "[key]=", "invalid UTF8 character in input (expected a value)"},
|
|
// {"basic string value", "a=\"\xbc\"", "[a]=", "invalid UTF8 character in input (expected string contents)"},
|
|
// })
|
|
// }
|
|
|
|
// func TestWhiteSpaceAndNewlines(t *testing.T) {
|
|
// runStatesTs(t, []statesT{
|
|
// {"space", " ", "", ""},
|
|
// {"tab", "\t", "", ""},
|
|
// {"newline", "\n", "", ""},
|
|
// {"all blanks and newlines", " \t \t \r\n\n \n \t", "", ""},
|
|
// {"bare carriage return", "\r", "", "unexpected character '\\r' (expected end of file)"},
|
|
// })
|
|
// }
|