# Packages and files may be given in any order; these commands are equivalent.
# Issue: https://cuelang.org/issue/2273

# Two CUE files, either order.
exec cue vet schema.cue pass.yml
exec cue vet pass.yml schema.cue

# A package before the data file.
exec cue vet cue.test:schema pass.yml

# A package after the data file: also works.
exec cue vet pass.yml cue.test:schema

# A package interspersed between two data files: also works.
exec cue vet pass.yml cue.test:schema pass2.yml

# A bare scope qualifier still applies to the file that follows it,
# even when that file name looks like a package.
exec cue vet cue.test:schema yaml: pass.yml

# A scope qualifier forces the following argument to be read as a file even
# when it would otherwise be interpreted as a package: "noext" has no file
# extension, so on its own it is treated as a package (see below).
exec cue vet schema.cue yaml: noext

# Without the scope qualifier, "noext" is treated as a package rather than a
# file, and there is no such package to load.
! exec cue vet schema.cue noext
stderr 'cannot be imported as a CUE package'

-- cue.mod/module.cue --
module: "cue.test"
language: version: "v0.9.0"
-- schema.cue --
package schema

a: int
b: string
-- pass.yml --
a: 123
b: "a string"
-- pass2.yml --
a: 123
b: "a string"
-- noext --
a: 123
b: "a string"
