exec cue import -o - --recursive ./import/data.json
cmp stdout expect-stdout
-- expect-stdout --
import (
	"encoding/json"
	"encoding/yaml"
)

foo: {
	name:  "something"
	json1: json.Marshal(_cue_json1)
	let _cue_json1 = [1, 2]
	json2: json.Marshal(_cue_json2)
	let _cue_json2 = {
		key: "value"
	}
	yaml1: yaml.Marshal(_cue_yaml1)
	let _cue_yaml1 = {
		a: "b"
		c: "d"
	}
	yaml2: yaml.Marshal(_cue_yaml2)
	let _cue_yaml2 = [
		"one",
		"two",
	]
	nocodec1: "\"str\""
	nocodec2: "1234"
	nocodec3: "null"
	nocodec4: "true"
	nocodec5: "[a-z]+"
	nocodec6: "a: 123"
	nocodec7: "[a-z]+"
	nocodec8: "[a]"
	nocodec9: "{a: 1, b: 2}"
}
-- import/data.json --
{
    "foo": {
        "name": "something",
        "json1": "[1, 2]",
        "json2": "{\"key\": \"value\"}",
        "yaml1": "a: b\nc: d",
        "yaml2": "- one\n- two",
        "nocodec1": "\"str\"",
        "nocodec2": "1234",
        "nocodec3": "null",
        "nocodec4": "true",
        "nocodec5": "[a-z]+",
        "nocodec6": "a: 123",
        "nocodec7": "[a-z]+",
        "nocodec8": "[a]",
        "nocodec9": "{a: 1, b: 2}"
    }
}
