! exec cue eval -e nonExist
cmp stderr expect/nonExist/stderr
cmp stdout expect/nonExist/stdout

# Issue #550: ignore incomplete error in different package
exec cue eval -e incomplete
cmp stderr expect/incomplete/stderr
cmp stdout expect/incomplete/stdout

# Issue #384
! exec cue eval foo.bar
cmp stderr expect/foobar/stderr

# Issue #999
exec cue export --out text -e 'yaml.MarshalStream(X)' issue999/x.cue
cmp stdout expect/issue999/stdout

# Issue #4202: cue eval -e should not produce an internal error
# when a for comprehension's if-guard references the same definition
# used in a pattern constraint on the iterated struct.
exec cue eval -e _out issue4202/x.cue
cmp stdout expect/issue4202/stdout

-- expect/nonExist/stdout --
-- expect/nonExist/stderr --
reference "nonExist" not found:
    --expression:1:1
-- expect/incomplete/stdout --

-- expect/incomplete/stderr --
-- expect/foobar/stdout --

-- expect/foobar/stderr --
unknown file extension .bar
-- input/ --
-- partial.cue --
package exitcode

import (
	pkg "foo.com/example"
)

a: 1

incomplete: pkg.Settings

foo: bar: "hello"


-- cue.mod/module.cue --
module: "test.example"
language: version: "v0.9.0"
-- cue.mod/pkg/foo.com/example/example.cue --
package example

Settings: {}
blah: Settings.anyKey

-- issue999/x.cue --
X: [
	{
		a: 1
	},
	{
		b: 2
	},
]

-- expect/issue999/stdout --
a: 1
---
b: 2

-- issue4202/x.cue --
#K: string

x: [#K]: _
x: a: 1

_out: [
	for k, v in x
	if k =~ #K {v},
]
-- expect/issue4202/stdout --

[
    for k, v in X
    if k =~ K.#x {
        v
    }]

//cue:path: x
let X = {
    {
        [K.#x]: _
    }
    a: 1
}

//cue:path: #K
let K = {
    #x: string
}
