blob: ee50d96c067b5a02a57786f3693104b82393842f [file] [log] [blame]
# Test that cue get go works when used without the --local flag
# cue get go currently appear to act like a wrapper around go get.
# But this is going to change: "cue get go" will be renamed "cue import go".
# When that change happens, cue import go will assume that all
# required dependencies are present, and fail otherwise.
go get example.com/blah@v1.0.0
go mod tidy
# cue get go
cue get go example.com/blah
cmp cue.mod/gen/example.com/blah/blah_go_gen.cue cue.mod/gen/example.com/blah/blah_go_gen.cue.golden
cmp cue.mod/gen/example.com/blah/blah_gen.cue cue.mod/gen/example.com/blah/blah_gen.cue.golden
# Verify dependencies are as expected
cmp go.mod go.mod.golden
-- cue.mod/module.cue --
module: "mod.com/blah"
-- go.mod --
module mod.com/blah
go 1.14
-- go.mod.golden --
module mod.com/blah
go 1.14
require example.com/blah v1.0.0
-- cuedeps.go --
// +build cuedeps
package cuedeps
import (
_ "example.com/blah"
)
-- cue.mod/gen/example.com/blah/blah_go_gen.cue.golden --
// Code generated by cue get go. DO NOT EDIT.
//cue:generate cue get go example.com/blah
package blah
#Name: "Orange"
-- cue.mod/gen/example.com/blah/blah_gen.cue.golden --
// Code generated by cue get go. DO NOT EDIT.
//cue:generate cue get go example.com/blah
package blah
Type: "Fruit"