# Test what happens when there is an error an embedded file.
# The error should mention the name of the file where the error is.

! 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
    schema.json:10:7
-- 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"
    }
  }
}
