# Test whether an import with a _ qualifer is allowed or not.

! exec cue export ./foo
cmp stderr want-stderr

# Check that it also fails with an explicit _ qualifier
# specified on the command line
! exec cue export other.example/m:_
cmp stderr want-stderr-2
-- want-stderr --
test.example/foo/foo@v0: import failed: _ is not a valid import path qualifier in "other.example/m:_":
    ./foo/foo.cue:8:8
test.example/foo/foo@v0: import failed: cannot find package "other.example/m": _ is not a valid import path qualifier in "other.example/m:_":
    ./foo/foo.cue:8:8
-- want-stderr-2 --
invalid import path qualifier _ in "other.example/m:_"
-- cue.mod/gen/other.example/m/m.cue --
package _
x: 20

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

-- foo/foo.cue --
// Note: the package name does not match the directory name,
// which means that this is only resolvable with an explicit
// qualifier when used as an import path, but is allowed
// on the cue command line because there's only one
// package in the directory.
package bar

import m "other.example/m:_"

x: m.x
