diff --git a/cmd/cue/cmd/testdata/script/embed_file_err.txtar b/cmd/cue/cmd/testdata/script/embed_file_err.txtar new file mode 100644 index 00000000000..cc70cf2ab20 --- /dev/null +++ b/cmd/cue/cmd/testdata/script/embed_file_err.txtar @@ -0,0 +1,39 @@ +# Test what happens when there is an error an embedded file. +# TODO the error should mention the name of the file where the error is. + +env CUE_EXPERIMENT=embed +! exec cue vet +cmp stderr want-stderr +! exec cue export +cmp stderr want-stderr +! exec cue def +cmp stderr want-stderr + +-- want-stderr -- +@embed: invalid string: + ./x.cue:5:6 +-- cue.mod/module.cue -- +module: "test.example" +language: version: "v0.9.2" +-- x.cue -- +@extern(embed) + +package x + +e: _ @embed(glob="*.json",type=jsonschema) + +-- schema.json -- +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "additionalProperties": false, + "id": "https://example.test/example", + "required": ["x"], + "title": "example jsonschema", + "type": "object", + "properties": { + "x": { + "description": true, + "type": "number" + } + } +}