Skip to content

Commit 7043f8d

Browse files
committed
add unit test
Signed-off-by: Stephanie <yangcao@redhat.com>
1 parent a15245d commit 7043f8d

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

pkg/devfile/parser/context/apiVersion_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ import (
99
func TestSetDevfileAPIVersion(t *testing.T) {
1010

1111
const (
12-
schemaVersion = "2.0.0"
13-
validJson = `{"schemaVersion": "2.0.0"}`
12+
schemaVersion = "2.2.0"
13+
validJson = `{"schemaVersion": "2.2.0"}`
14+
concreteSchema = `{"schemaVersion": "2.2.0-latest"}`
1415
emptyJson = "{}"
1516
emptySchemaVersionJson = `{"schemaVersion": ""}`
1617
devfilePath = "/testpath/devfile.yaml"
@@ -30,6 +31,12 @@ func TestSetDevfileAPIVersion(t *testing.T) {
3031
want: schemaVersion,
3132
wantErr: nil,
3233
},
34+
{
35+
name: "concrete schemaVersion",
36+
devfileCtx: DevfileCtx{rawContent: []byte(concreteSchema), absPath: devfilePath},
37+
want: schemaVersion,
38+
wantErr: nil,
39+
},
3340
{
3441
name: "schemaVersion not present",
3542
devfileCtx: DevfileCtx{rawContent: []byte(emptyJson), absPath: devfilePath},

0 commit comments

Comments
 (0)