github.com/octohelm/cuemod@v0.9.4/pkg/cuex/build_test.go (about)

     1  package cuex
     2  
     3  import (
     4  	"fmt"
     5  	"testing"
     6  )
     7  
     8  func TestInstanceFromRaw(t *testing.T) {
     9  	inst, _ := InstanceFromTemplateAndOverwrites([]byte(`
    10  name: test: *"1111" | string
    11  `), []byte(`
    12  import t "t"
    13  
    14  t & {
    15  	name: test: "2222"
    16  }
    17  `))
    18  	data, err := Eval(inst, WithEncoding(CUE))
    19  	fmt.Println(string(data), err)
    20  
    21  	data2, err2 := Eval(inst, WithEncoding(YAML))
    22  	fmt.Println(string(data2), err2)
    23  }