This repository has been archived on 2019-06-23. You can view files and clone it, but cannot push or open issues or pull requests.
mumbledj/vendor/github.com/hashicorp/hcl/lex_test.go
2016-06-20 17:50:40 -07:00

38 lines
404 B
Go

package hcl
import (
"testing"
)
func TestLexMode(t *testing.T) {
cases := []struct {
Input string
Mode lexModeValue
}{
{
"",
lexModeHcl,
},
{
"foo",
lexModeHcl,
},
{
"{}",
lexModeJson,
},
{
" {}",
lexModeJson,
},
}
for i, tc := range cases {
actual := lexMode([]byte(tc.Input))
if actual != tc.Mode {
t.Fatalf("%d: %#v", i, actual)
}
}
}