Skip to content

Commit 6ebde13

Browse files
committed
test: add disabled test for BCP47 tag
Go's language.Parse() is more lenient and allows non-BCP47 language tags. Let's add a disabled test for now. Related to italia#47.
1 parent 00698e9 commit 6ebde13

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

parser_test.go

+6
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,12 @@ func TestInvalidTestcasesV0_2(t *testing.T) {
380380
"localisation_availableLanguages_invalid.yml": ValidationErrors{
381381
ValidationError{"localisation.availableLanguages[0]", "must be a valid BCP 47 language", 56, 3},
382382
},
383+
// TODO: Enable this test when https://github.com/italia/publiccode-parser-go/issues/47
384+
// is fixed
385+
//
386+
// "localisation_availableLanguages_invalid_bcp47.yml": ValidationErrors{
387+
// ValidationError{"localisation.availableLanguages[0]", "must be a valid BCP 47 language", 56, 3},
388+
// },
383389
"localisation_localisationReady_missing.yml": ValidationErrors{
384390
ValidationError{"localisation.localisationReady", "required", 58, 3},
385391
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
publiccodeYmlVersion: "0.2"
2+
3+
name: Medusa
4+
url: "https://github.com/italia/developers.italia.it.git"
5+
softwareVersion: "dev"
6+
releaseDate: "2017-04-15"
7+
8+
inputTypes:
9+
- application/x.empty
10+
outputTypes:
11+
- application/x.empty
12+
13+
platforms:
14+
- web
15+
16+
categories:
17+
- cloud-management
18+
19+
developmentStatus: development
20+
21+
softwareType: "standalone/other"
22+
23+
description:
24+
eng:
25+
localisedName: Medusa
26+
genericName: Text Editor
27+
shortDescription: >
28+
A rather short description which
29+
is probably useless
30+
longDescription: >
31+
Very long description of this software, also split
32+
on multiple rows. You should note what the software
33+
is and why one should need it. This is 158 characters.
34+
Very long description of this software, also split
35+
on multiple rows. You should note what the software
36+
is and why one should need it. This is 316 characters.
37+
Very long description of this software, also split
38+
on multiple rows. You should note what the software
39+
is and why one should need it. This is 474 characters.
40+
Very long description of this software, also split
41+
on multiple rows. You should note what the software
42+
is and why one should need it. This is 632 characters.
43+
features:
44+
- Just one feature
45+
46+
legal:
47+
license: AGPL-3.0-or-later
48+
49+
maintenance:
50+
type: "community"
51+
52+
contacts:
53+
- name: Francesco Rossi
54+
55+
localisation:
56+
localisationReady: true
57+
availableLanguages:
58+
# Should NOT validate: even if this a valid POSIX language tag
59+
# it's NOT a valid BCP47 language tag
60+
- hr_HR

0 commit comments

Comments
 (0)