Skip to content

Commit 443106f

Browse files
committed
mod/modfile: accept language versions after v0.8.0-alpha.0
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 <[email protected]> Change-Id: Ib16658bf8a54c3e35483318a12d4659939a5bb6c Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194685 Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
1 parent a8693a0 commit 443106f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

mod/modfile/modfile_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ var parseTests = []struct {
3939
parse: Parse,
4040
data: `
4141
module: "foo.com/bar@v0"
42-
language: version: "v0.8.0"
42+
language: version: "v0.8.0-alpha.0"
4343
`,
4444
want: &File{
4545
Module: "foo.com/bar@v0",
4646
Language: &Language{
47-
Version: "v0.8.0",
47+
Version: "v0.8.0-alpha.0",
4848
},
4949
},
5050
wantDefaults: map[string]string{
@@ -458,7 +458,7 @@ language: {
458458
}
459459

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

464464
func TestLatestKnownSchemaVersion(t *testing.T) {

mod/modfile/schema.cue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ versions: [string]: {
3939
#Strict!: _
4040
}
4141

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

0 commit comments

Comments
 (0)