# Embedding at the file level should still close the package and validate
# correctly against files from other packages without first merging these
# files, thereby effectively embedding them and averting the closed check.

skip
# extra hyphen...
# mostly because it is unclear how to decode multi-doc yaml
# not a huge fan of CUE splitting it into different files
# prefer to make it a list of values
# there should be a flag to split yaml-stream / jsonl into separate instances or files
#  (TBD)

# Issue #743 (CUE)

! exec hof vet schema.cue foo.yaml
cmp stderr expect-foo

! exec hof vet schema.cue stream.yaml
cmp stderr expect-stream

-- schema.cue --
package schema

#Foo: {
    a: int
    b?: int
}
#Foo

-- foo.yaml --
a: 1
c: 2

-- stream.yaml --
a: 1
d: 2
---
a: 1
e: 2

-- expect-foo --
c: field not allowed:
    ./foo.yaml:2:2
    ./schema.cue:1:1
    ./schema.cue:3:7
    ./schema.cue:7:1
-- expect-stream --
d: field not allowed:
    ./schema.cue:1:1
    ./schema.cue:3:7
    ./schema.cue:7:1
    ./stream.yaml:2:2
-- expect-stream --
d: field not allowed:
    ./schema.cue:1:1
    ./schema.cue:3:7
    ./schema.cue:7:1
    ./stream.yaml:2:2
