hcl/parser/parser_test.go

18 lines
328 B
Go
Raw Normal View History

2015-10-11 23:27:43 +00:00
package parser
import "testing"
2015-10-11 23:27:43 +00:00
2015-10-12 19:53:40 +00:00
func TestAssignStatement(t *testing.T) {
2015-10-11 23:27:43 +00:00
src := `ami = "${var.foo}"`
p := New([]byte(src))
p.enableTrace = true
2015-10-12 07:37:37 +00:00
n, err := p.Parse()
if err != nil {
t.Fatal(err)
}
2015-10-11 23:27:43 +00:00
if n.Pos().Line != 1 {
t.Errorf("AssignStatement position is wrong\n\twant: '%d'\n\tgot : '%d'", 1, n.Pos().Line)
}
2015-10-11 23:27:43 +00:00
}