go-toml/comment_test.go

22 lines
604 B
Go

package toml
import (
"testing"
)
func TestComment2(t *testing.T) {
for _, test := range []parseToASTTest{
{``, `{}`, `unexpected end of file (expected comment) at start of file`},
{`#`, `{}`, ``},
{`# `, `{}`, ``},
{`# with data`, `{}`, ``},
{"# ending in EOL & EOF\r\n", `{}`, ``},
{`# \xxx/ \u can't escape/`, `{}`, ``},
{"# \tlexe\r accepts embedded ca\r\riage \returns\r\n", `{}`, ``},
{"# with data and newline\ncode continues here", `{}`, `unexpected input (expected end of file) at line 2, column 1`},
} {
p := newParser()
testParseToAST(t, p, p.startComment, test)
}
}