# Test that a relative package path functions the same as an absolute package path
# when there is a single package in the directory with a name
# that does not match the final element of the import path.

! exec cue eval root.cue
cmp stderr import_stderr.golden
! exec cue eval mod.com/x
cmp stderr absolute_stderr.golden
# TODO: the following command succeeds unexpectedly,
# although it should be consistent with the above.
exec cue eval ./x

-- cue.mod/module.cue --
module: "mod.com"
language: version: "v0.9.0"
-- root.cue --
package root

import "mod.com/x"

x
-- x/y.cue --
package y

y: 5
-- import_stderr.golden --
import failed: cannot find package "mod.com/x": no files in package directory with package name "x":
    ./root.cue:3:8
-- absolute_stderr.golden --
cannot find package "mod.com/x": no files in package directory with package name "x"
