! exec cue def ./a
cmp stderr a-stderr

exec cue def ./b
cmp stdout b-stdout

exec cue def ./c
cmp stdout c-stdout

! exec cue def ./d
cmp stderr d-stderr

-- a-stderr --
cannot import package as definition identifier:
    ./a/a.cue:3:11
-- b-stdout --
package b

import _s "strings"

x: _s.ToUpper("foo")
-- c-stdout --
package c

import "test.example/other1:_x"

_x
-- d-stderr --
import failed: invalid package name #x:
    ./d/d.cue:3:8
    ./other2/other.cue:1:11
-- cue.mod/module.cue --
module: "test.example"
language: version: "v0.11.0"

-- a/a.cue --
package a

import #s "strings"

x: #s.ToUpper("foo")

-- b/b.cue --
package b

import _s "strings"

x: _s.ToUpper("foo")

-- c/c.cue --
package c

import "test.example/other1:_x"

_x

-- d/d.cue --
package d

import "test.example/other2:#x"

#x

-- other1/other.cue --
package _x

foo: "bar"

-- other2/other.cue --
package #x

foo: "bar"
