Skip to content

Commit 454a04d

Browse files
authored
test: add unkown field test (#253)
1 parent b7193c8 commit 454a04d

2 files changed

Lines changed: 56 additions & 0 deletions

File tree

parser_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,9 @@ func TestInvalidTestcasesV0(t *testing.T) {
614614
ValidationError{"localisation.localisationReady", "localisationReady is a required field", 4, 15},
615615
ValidationError{"localisation.availableLanguages", "availableLanguages is a required field", 4, 15},
616616
},
617+
"unknown_field.yml": ValidationResults{
618+
ValidationError{"foobar", "field foobar not found in type publiccode.PublicCodeV0", 10, 1},
619+
},
617620
}
618621

619622
dir := "testdata/v0/invalid/"
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
publiccodeYmlVersion: "0.4"
2+
3+
name: Medusa
4+
url: "https://github.com/italia/developers.italia.it.git"
5+
6+
platforms:
7+
- web
8+
9+
# Should NOT validate: there's no `foobar` field in publiccode.yml
10+
foobar: 123
11+
12+
categories:
13+
- cloud-management
14+
15+
developmentStatus: development
16+
17+
softwareType: "standalone/other"
18+
19+
description:
20+
en-GB:
21+
localisedName: Medusa
22+
shortDescription: >
23+
A rather short description which
24+
is probably useless
25+
longDescription: >
26+
Very long description of this software, also split
27+
on multiple rows. You should note what the software
28+
is and why one should need it. This is 158 characters.
29+
Very long description of this software, also split
30+
on multiple rows. You should note what the software
31+
is and why one should need it. This is 316 characters.
32+
Very long description of this software, also split
33+
on multiple rows. You should note what the software
34+
is and why one should need it. This is 474 characters.
35+
Very long description of this software, also split
36+
on multiple rows. You should note what the software
37+
is and why one should need it. This is 632 characters.
38+
features:
39+
- Just one feature
40+
41+
legal:
42+
license: AGPL-3.0-or-later
43+
44+
maintenance:
45+
type: "community"
46+
47+
contacts:
48+
- name: Francesco Rossi
49+
50+
localisation:
51+
localisationReady: true
52+
availableLanguages:
53+
- en

0 commit comments

Comments
 (0)