27 lines
450 B
Go
27 lines
450 B
Go
|
package model
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
"github.com/zclconf/go-cty/cty"
|
||
|
)
|
||
|
|
||
|
func TestPrintNoTokens(t *testing.T) {
|
||
|
b := &Block{
|
||
|
Type: "block", Body: &Body{
|
||
|
Items: []BodyItem{
|
||
|
&Attribute{
|
||
|
Name: "attribute",
|
||
|
Value: &LiteralValueExpression{
|
||
|
Value: cty.True,
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
}
|
||
|
expected := "block {\n attribute = true\n}"
|
||
|
assert.Equal(t, expected, fmt.Sprintf("%v", b))
|
||
|
}
|