# Check that cue mod get chooses the latest major version
# when none is specified.

exec cue mod get foo.org/bar
cmp cue.mod/module.cue want-module
exec cue export .
cmp stdout want-stdout

-- want-module --
module: "main.example"
language: {
	version: "v0.8.0"
}
deps: {
	"foo.org/bar@v2": {
		v: "v2.0.0"
	}
}
-- want-stdout --
{
    "foo.org/bar@v2": "v2.0.0"
}
-- cue.mod/module.cue --
module: "main.example"
language: version: "v0.8.0"
-- main.cue --
package main
import "foo.org/bar"
bar

-- _registry/foo.org_bar_v2.0.0/cue.mod/module.cue --
module: "foo.org/bar@v2"
language: version: "v0.8.0"

-- _registry/foo.org_bar_v2.0.0/bar.cue --
package bar
"foo.org/bar@v2": "v2.0.0"

-- _registry/foo.org_bar_v1.0.0/cue.mod/module.cue --
module: "foo.org/bar@v1"
language: version: "v0.8.0"

-- _registry/foo.org_bar_v1.0.0/bar.cue --
package bar
"foo.org/bar@v1": "v1.0.0"

-- _registry/foo.org_bar_v1.1.0/cue.mod/module.cue --
module: "foo.org/bar@v1"
language: version: "v0.8.0"

-- _registry/foo.org_bar_v1.1.0/bar.cue --
package bar
"foo.org/bar@v1": "v1.1.0"
