diff --git a/cmd/cue/cmd/testdata/script/modinit_with_version.txtar b/cmd/cue/cmd/testdata/script/modinit_with_version.txtar deleted file mode 100644 index 44f036dbc..000000000 --- a/cmd/cue/cmd/testdata/script/modinit_with_version.txtar +++ /dev/null @@ -1,18 +0,0 @@ -# Check that cue mod init adds the language version. -env CUE_VERSION_OVERRIDE=v0.1.2 -exec cue mod init foo.example -cmp cue.mod/module.cue want-module - -# cue mod tidy should be a no-op after cue mod init -exec cue mod tidy -cmp cue.mod/module.cue want-module - --- want-module -- -module: "foo.example@v0" -language: { - version: "v0.1.2" -} --- _registry/example.com_e_v0.0.1/cue.mod/module.cue -- -module: "example.com/e@v0" --- _registry/example.com_e_v0.0.1/main.cue -- -package e diff --git a/cmd/cue/cmd/testdata/script/modinit_without_version.txtar b/cmd/cue/cmd/testdata/script/modinit_without_version.txtar new file mode 100644 index 000000000..36fe508e2 --- /dev/null +++ b/cmd/cue/cmd/testdata/script/modinit_without_version.txtar @@ -0,0 +1,15 @@ +# Check that cue mod init skips the language version +# when it lacks any version information at all. +# A zero pseudo-version is one such case, as there are no semver numbers. +env CUE_EXPERIMENT=modules +env CUE_VERSION_OVERRIDE=v0.0.0-00010101000000-000000000000 +exec cue mod init foo.example +cmp cue.mod/module.cue want-module + +# cue mod tidy should be a no-op after cue mod init +env CUE_CACHE_DIR=$WORK/.tmp/cache +exec cue mod tidy +cmp cue.mod/module.cue want-module + +-- want-module -- +module: "foo.example@v0"