go-toml/value_boolean_test.go

21 lines
709 B
Go

package parser
import (
"testing"
)
func TestBoolean(t *testing.T) {
for _, test := range []parseTest{
{``, []string{`Error: unexpected end of file (expected true or false) at start of file`}},
{`true`, []string{`boolean(true)`}},
{`false`, []string{`boolean(false)`}},
{`yes`, []string{`Error: unexpected input (expected true or false) at start of file`}},
{`no`, []string{`Error: unexpected input (expected true or false) at start of file`}},
{`1`, []string{`Error: unexpected input (expected true or false) at start of file`}},
{`0`, []string{`Error: unexpected input (expected true or false) at start of file`}},
} {
p := &parser{}
testParseHandler(t, p, p.startBoolean, test)
}
}