Skip to content

Commit

Permalink
mod/modfile: accept language versions after v0.8.0-alpha.0
Browse files Browse the repository at this point in the history
Currently, the earliest supported version is v0.8.0, but some people
were using the first modules experiment alpha versions just before that,
so allow versions from v0.8.0-alpha.0 instead.

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: Ib16658bf8a54c3e35483318a12d4659939a5bb6c
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194685
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
  • Loading branch information
rogpeppe committed May 15, 2024
1 parent a8693a0 commit 443106f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions mod/modfile/modfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ var parseTests = []struct {
parse: Parse,
data: `
module: "foo.com/bar@v0"
language: version: "v0.8.0"
language: version: "v0.8.0-alpha.0"
`,
want: &File{
Module: "foo.com/bar@v0",
Language: &Language{
Version: "v0.8.0",
Version: "v0.8.0-alpha.0",
},
},
wantDefaults: map[string]string{
Expand Down Expand Up @@ -458,7 +458,7 @@ language: {
}

func TestEarliestClosedSchemaVersion(t *testing.T) {
qt.Assert(t, qt.Equals(EarliestClosedSchemaVersion(), "v0.8.0"))
qt.Assert(t, qt.Equals(EarliestClosedSchemaVersion(), "v0.8.0-alpha.0"))
}

func TestLatestKnownSchemaVersion(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion mod/modfile/schema.cue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ versions: [string]: {
#Strict!: _
}

versions: "v0.8.0": {
versions: "v0.8.0-alpha.0": {
// Define this version in terms of the later versions
// rather than the other way around, so that
// the latest version is clearest.
Expand Down

0 comments on commit 443106f

Please sign in to comment.