# 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 matches the final element of the import path.

exec cue eval root.cue
cmp stdout output.golden
exec cue eval mod.com/x
cmp stdout output.golden
exec cue eval ./x
cmp stdout output.golden

# Also test that the above all works when using an explicit qualifier.

exec cue eval root_qualifier.cue
cmp stdout output.golden
exec cue eval mod.com/x:x
cmp stdout output.golden
exec cue eval ./x:x
cmp stdout output.golden

-- output.golden --
x: 5
-- cue.mod/module.cue --
module: "mod.com"
language: version: "v0.9.0"
-- root.cue --
package root

import "mod.com/x"

x
-- root_qualifier.cue --
package root

import "mod.com/x:x"

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

x: 5
