hcl/parser/parser_test.go
2015-10-12 02:49:07 +03:00

20 lines
415 B
Go

package parser
import "testing"
func TestAssignStatment(t *testing.T) {
src := `ami = "${var.foo}"`
p := New([]byte(src))
p.enableTrace = true
n := p.Parse()
if n.String() != src {
t.Errorf("AssignStatement is not parsed correctly\n\twant: '%s'\n\tgot : '%s'", src, n.String())
}
if n.Pos().Line != 1 {
t.Errorf("AssignStatement position is wrong\n\twant: '%d'\n\tgot : '%d'", 1, n.Pos().Line)
}
}