wip: string parsing

This commit is contained in:
Thomas Pelletier
2021-01-30 20:31:14 -05:00
parent b4bb91fc13
commit abe1005d7a
2 changed files with 501 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
package toml
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
func TestParse(t *testing.T) {
inputs := []string{
` #foo`,
`#foo`,
`#`,
"\n\n\n",
"#one\n # two \n",
`a`,
`abc`,
` abc # foo`,
`'abc'`,
`"foo bar"`,
`"hello\tworld"`,
`"hello \u1234 foo"`,
}
for i, data := range inputs {
t.Run(fmt.Sprintf("example %d", i), func(t *testing.T) {
doc, err := Parse([]byte(data))
assert.NoError(t, err)
fmt.Println(doc)
})
}
}