forked from italia/publiccode-parser-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathv1_test.go
More file actions
33 lines (28 loc) · 703 Bytes
/
v1_test.go
File metadata and controls
33 lines (28 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package publiccode
import (
"path/filepath"
"testing"
)
func TestInvalidTestcasesV1(t *testing.T) {
dirs := []string{"testdata/v1/invalid/",
"testdata/v1/invalid_valid_in_v0/",
"testdata/v1/invalid_valid_with_warnings_in_v0/",
}
expected := ValidationResults{
ValidationError{
"publiccodeYmlVersion",
"unsupported version: '1'. Supported versions: 0, 0.2, 0.2.0, 0.2.1, 0.2.2, 0.3, 0.3.0, 0.4, 0.4.0, 0.5.0, 0.5",
0,
0,
},
}
for _, dir := range dirs {
testFiles, _ := filepath.Glob(dir + "*yml")
for _, file := range testFiles {
t.Run(file, func(t *testing.T) {
err := parseNoNetwork(file)
checkParseErrors(t, err, testType{file, expected})
})
}
}
}