21 lines
691 B
Go
21 lines
691 B
Go
package toml
|
|
|
|
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{`true`}},
|
|
{`false`, []string{`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 := newParser()
|
|
testParseHandler(t, p, p.startBoolean, test)
|
|
}
|
|
}
|