Skip to content

Commit 59db8e8

Browse files
committed
test: "eng" is not a valid BCP language
Change the tests so there's no invalid BCP "eng" language. We don't catch that as an error yet because of italia#47.
1 parent 416889b commit 59db8e8

File tree

114 files changed

+438
-261
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+438
-261
lines changed

parser_test.go

+45-45
Original file line numberDiff line numberDiff line change
@@ -361,72 +361,72 @@ func TestInvalidTestcasesV0(t *testing.T) {
361361
"description_invalid_language.yml": ValidationResults{
362362
ValidationError{"description", "must use a valid BCP 47 language", 18, 1},
363363
},
364-
"description_eng_features_missing.yml": ValidationResults{
365-
ValidationError{"description.eng.features", "must be more than 0", 22, 5},
364+
"description_en_features_missing.yml": ValidationResults{
365+
ValidationError{"description.en.features", "must be more than 0", 22, 5},
366366
},
367-
"description_eng_features_empty.yml": ValidationResults{
368-
ValidationError{"description.eng.features", "must be more than 0", 39, 5},
367+
"description_en_features_empty.yml": ValidationResults{
368+
ValidationError{"description.en.features", "must be more than 0", 39, 5},
369369
},
370-
"description_eng_localisedName_wrong_type.yml": ValidationResults{
371-
ValidationError{"description.eng.localisedName", "wrong type for this field", 21, 1},
370+
"description_en_localisedName_wrong_type.yml": ValidationResults{
371+
ValidationError{"description.en.localisedName", "wrong type for this field", 21, 1},
372372
},
373-
"description_eng_genericName_too_long.yml": ValidationResults{
374-
ValidationError{"description.eng.genericName", "must be less or equal than 35", 22, 5},
375-
ValidationWarning{"description.eng.genericName", "This key is DEPRECATED and will be removed in the future", 22, 5},
373+
"description_en_genericName_too_long.yml": ValidationResults{
374+
ValidationError{"description.en.genericName", "must be less or equal than 35", 22, 5},
375+
ValidationWarning{"description.en.genericName", "This key is DEPRECATED and will be removed in the future", 22, 5},
376376
},
377-
"description_eng_shortDescription_missing.yml": ValidationResults{
378-
ValidationError{"description.eng.shortDescription", "required", 20, 5},
377+
"description_en_shortDescription_missing.yml": ValidationResults{
378+
ValidationError{"description.en.shortDescription", "required", 20, 5},
379379
},
380-
"description_eng_shortDescription_too_short.yml": ValidationResults{
381-
ValidationError{"description.eng.shortDescription", "required", 20, 5},
380+
"description_en_shortDescription_too_short.yml": ValidationResults{
381+
ValidationError{"description.en.shortDescription", "required", 20, 5},
382382
},
383-
"description_eng_longDescription_missing.yml": ValidationResults{
384-
ValidationError{"description.eng.longDescription", "required", 20, 5},
383+
"description_en_longDescription_missing.yml": ValidationResults{
384+
ValidationError{"description.en.longDescription", "required", 20, 5},
385385
},
386-
"description_eng_longDescription_too_long.yml": ValidationResults{
387-
ValidationError{"description.eng.longDescription", "must be less or equal than 10000", 27, 5},
386+
"description_en_longDescription_too_long.yml": ValidationResults{
387+
ValidationError{"description.en.longDescription", "must be less or equal than 10000", 27, 5},
388388
},
389-
"description_eng_longDescription_too_short.yml": ValidationResults{
390-
ValidationError{"description.eng.longDescription", "must be more or equal than 150", 27, 5},
389+
"description_en_longDescription_too_short.yml": ValidationResults{
390+
ValidationError{"description.en.longDescription", "must be more or equal than 150", 27, 5},
391391
},
392-
"description_eng_longDescription_too_short_grapheme_clusters.yml": ValidationResults{
393-
ValidationError{"description.eng.longDescription", "must be more or equal than 150", 28, 5},
392+
"description_en_longDescription_too_short_grapheme_clusters.yml": ValidationResults{
393+
ValidationError{"description.en.longDescription", "must be more or equal than 150", 28, 5},
394394
},
395-
"description_eng_documentation_invalid.yml": ValidationResults{
396-
ValidationError{"description.eng.documentation", "must be an HTTP URL", 25, 5},
397-
ValidationError{"description.eng.documentation", "'not_a_url' not reachable: missing URL scheme", 25, 5},
395+
"description_en_documentation_invalid.yml": ValidationResults{
396+
ValidationError{"description.en.documentation", "must be an HTTP URL", 25, 5},
397+
ValidationError{"description.en.documentation", "'not_a_url' not reachable: missing URL scheme", 25, 5},
398398
},
399-
"description_eng_documentation_wrong_type.yml": ValidationResults{
400-
ValidationError{"description.eng.documentation", "wrong type for this field", 25, 1},
401-
ValidationError{"description.eng.documentation", "must be an HTTP URL", 25, 5},
402-
ValidationError{"description.eng.documentation", "'' not reachable: missing URL scheme", 25, 5},
399+
"description_en_documentation_wrong_type.yml": ValidationResults{
400+
ValidationError{"description.en.documentation", "wrong type for this field", 25, 1},
401+
ValidationError{"description.en.documentation", "must be an HTTP URL", 25, 5},
402+
ValidationError{"description.en.documentation", "'' not reachable: missing URL scheme", 25, 5},
403403
},
404-
"description_eng_apiDocumentation_invalid.yml": ValidationResults{
405-
ValidationError{"description.eng.apiDocumentation", "must be an HTTP URL", 41, 5},
406-
ValidationError{"description.eng.apiDocumentation", "'abc' not reachable: missing URL scheme", 41, 5},
404+
"description_en_apiDocumentation_invalid.yml": ValidationResults{
405+
ValidationError{"description.en.apiDocumentation", "must be an HTTP URL", 41, 5},
406+
ValidationError{"description.en.apiDocumentation", "'abc' not reachable: missing URL scheme", 41, 5},
407407
},
408-
"description_eng_apiDocumentation_wrong_type.yml": ValidationResults{
409-
ValidationError{"description.eng.apiDocumentation", "wrong type for this field", 43, 1},
410-
ValidationError{"description.eng.apiDocumentation", "must be an HTTP URL", 43, 5},
411-
ValidationError{"description.eng.apiDocumentation", "'' not reachable: missing URL scheme", 43, 5},
408+
"description_en_apiDocumentation_wrong_type.yml": ValidationResults{
409+
ValidationError{"description.en.apiDocumentation", "wrong type for this field", 43, 1},
410+
ValidationError{"description.en.apiDocumentation", "must be an HTTP URL", 43, 5},
411+
ValidationError{"description.en.apiDocumentation", "'' not reachable: missing URL scheme", 43, 5},
412412
},
413-
"description_eng_screenshots_missing_file.yml": ValidationResults{
413+
"description_en_screenshots_missing_file.yml": ValidationResults{
414414
ValidationError{
415-
"description.eng.screenshots[0]",
415+
"description.en.screenshots[0]",
416416
"'no_such_file.png' is not an image: no such file : https://raw.githubusercontent.com/italia/developers.italia.it/main/no_such_file.png",
417417
20,
418418
5,
419419
},
420420
},
421-
"description_eng_awards_wrong_type.yml": ValidationResults{
422-
ValidationError{"description.eng.awards", "wrong type for this field", 40, 1},
421+
"description_en_awards_wrong_type.yml": ValidationResults{
422+
ValidationError{"description.en.awards", "wrong type for this field", 40, 1},
423423
},
424-
"description_eng_videos_invalid.yml": ValidationResults{
425-
ValidationError{"description.eng.videos[0]", "must be an HTTP URL", 20, 5},
426-
ValidationError{"description.eng.videos[0]", "'ABC' is not a valid video URL supporting oEmbed: invalid oEmbed link: ABC", 20, 5},
424+
"description_en_videos_invalid.yml": ValidationResults{
425+
ValidationError{"description.en.videos[0]", "must be an HTTP URL", 20, 5},
426+
ValidationError{"description.en.videos[0]", "'ABC' is not a valid video URL supporting oEmbed: invalid oEmbed link: ABC", 20, 5},
427427
},
428-
"description_eng_videos_invalid_oembed.yml": ValidationResults{
429-
ValidationError{"description.eng.videos[0]", "'https://google.com' is not a valid video URL supporting oEmbed: invalid oEmbed link: https://google.com", 20, 5},
428+
"description_en_videos_invalid_oembed.yml": ValidationResults{
429+
ValidationError{"description.en.videos[0]", "'https://google.com' is not a valid video URL supporting oEmbed: invalid oEmbed link: https://google.com", 20, 5},
430430
},
431431

432432
// legal
@@ -586,7 +586,7 @@ func TestValidTestcasesV0(t *testing.T) {
586586
func TestValidWithWarningsTestcasesV0(t *testing.T) {
587587
expected := map[string]error{
588588
"unicode_grapheme_clusters.yml": ValidationResults{
589-
ValidationWarning{"description.eng.genericName", "This key is DEPRECATED and will be removed in the future", 23, 5},
589+
ValidationWarning{"description.en.genericName", "This key is DEPRECATED and will be removed in the future", 23, 5},
590590
},
591591
"valid.minimal.v0.2.yml": ValidationResults{
592592
ValidationWarning{"publiccodeYmlVersion", "v0.2 is not the latest version, use '0.4.0'. Parsing this file as v0.4.0.", 1, 1},

testdata/v0/invalid/applicationSuite_wrong_type.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ developmentStatus: development
1919
softwareType: "standalone/other"
2020

2121
description:
22-
eng:
22+
en:
2323
localisedName: Medusa
2424
shortDescription: >
2525
A rather short description which
@@ -52,4 +52,4 @@ maintenance:
5252
localisation:
5353
localisationReady: true
5454
availableLanguages:
55-
- eng
55+
- en

testdata/v0/invalid/categories_empty.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ developmentStatus: development
1616
softwareType: "standalone/other"
1717

1818
description:
19-
eng:
19+
en:
2020
localisedName: Medusa
2121
shortDescription: >
2222
A rather short description which
@@ -49,4 +49,4 @@ maintenance:
4949
localisation:
5050
localisationReady: true
5151
availableLanguages:
52-
- eng
52+
- en

testdata/v0/invalid/categories_invalid.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ developmentStatus: development
1717
softwareType: "standalone/other"
1818

1919
description:
20-
eng:
20+
en:
2121
localisedName: Medusa
2222
shortDescription: >
2323
A rather short description which
@@ -50,4 +50,4 @@ maintenance:
5050
localisation:
5151
localisationReady: true
5252
availableLanguages:
53-
- eng
53+
- en

testdata/v0/invalid/categories_missing.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ developmentStatus: development
1616
softwareType: "standalone/other"
1717

1818
description:
19-
eng:
19+
en:
2020
localisedName: Medusa
2121
shortDescription: >
2222
A rather short description which
@@ -49,4 +49,4 @@ maintenance:
4949
localisation:
5050
localisationReady: true
5151
availableLanguages:
52-
- eng
52+
- en

testdata/v0/invalid/categories_nil.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ developmentStatus: development
1616
softwareType: "standalone/other"
1717

1818
description:
19-
eng:
19+
en:
2020
localisedName: Medusa
2121
shortDescription: >
2222
A rather short description which
@@ -49,4 +49,4 @@ maintenance:
4949
localisation:
5050
localisationReady: true
5151
availableLanguages:
52-
- eng
52+
- en

testdata/v0/invalid/dependsOn_open_name_wrong_type.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ developmentStatus: development
1515
softwareType: "standalone/other"
1616

1717
description:
18-
eng:
18+
en:
1919
localisedName: Medusa
2020
shortDescription: >
2121
A rather short description which
@@ -48,7 +48,7 @@ maintenance:
4848
localisation:
4949
localisationReady: true
5050
availableLanguages:
51-
- eng
51+
- en
5252

5353
dependsOn:
5454
open:

testdata/v0/invalid/dependsOn_open_optional_wrong_type.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ developmentStatus: development
1515
softwareType: "standalone/other"
1616

1717
description:
18-
eng:
18+
en:
1919
localisedName: Medusa
2020
shortDescription: >
2121
A rather short description which
@@ -48,7 +48,7 @@ maintenance:
4848
localisation:
4949
localisationReady: true
5050
availableLanguages:
51-
- eng
51+
- en
5252

5353
dependsOn:
5454
open:

testdata/v0/invalid/dependsOn_open_versionMax_wrong_type.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ developmentStatus: development
1515
softwareType: "standalone/other"
1616

1717
description:
18-
eng:
18+
en:
1919
localisedName: Medusa
2020
shortDescription: >
2121
A rather short description which
@@ -48,7 +48,7 @@ maintenance:
4848
localisation:
4949
localisationReady: true
5050
availableLanguages:
51-
- eng
51+
- en
5252

5353
dependsOn:
5454
open:

testdata/v0/invalid/dependsOn_open_versionMin_wrong_type.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ developmentStatus: development
1515
softwareType: "standalone/other"
1616

1717
description:
18-
eng:
18+
en:
1919
localisedName: Medusa
2020
shortDescription: >
2121
A rather short description which
@@ -48,7 +48,7 @@ maintenance:
4848
localisation:
4949
localisationReady: true
5050
availableLanguages:
51-
- eng
51+
- en
5252

5353
dependsOn:
5454
open:

testdata/v0/invalid/dependsOn_open_version_wrong_type.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ developmentStatus: development
1515
softwareType: "standalone/other"
1616

1717
description:
18-
eng:
18+
en:
1919
localisedName: Medusa
2020
shortDescription: >
2121
A rather short description which
@@ -48,7 +48,7 @@ maintenance:
4848
localisation:
4949
localisationReady: true
5050
availableLanguages:
51-
- eng
51+
- en
5252

5353
dependsOn:
5454
open:

testdata/v0/invalid/description_eng_apiDocumentation_invalid.yml testdata/v0/invalid/description_en_apiDocumentation_invalid.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ developmentStatus: development
1818
softwareType: "standalone/other"
1919

2020
description:
21-
eng:
21+
en:
2222
localisedName: Medusa
2323
shortDescription: >
2424
A rather short description which
@@ -55,4 +55,4 @@ maintenance:
5555
localisation:
5656
localisationReady: true
5757
availableLanguages:
58-
- eng
58+
- en

testdata/v0/invalid/description_eng_apiDocumentation_wrong_type.yml testdata/v0/invalid/description_en_apiDocumentation_wrong_type.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ developmentStatus: development
1818
softwareType: "standalone/other"
1919

2020
description:
21-
eng:
21+
en:
2222
localisedName: Medusa
2323
shortDescription: >
2424
A rather short description which
@@ -54,4 +54,4 @@ maintenance:
5454
localisation:
5555
localisationReady: true
5656
availableLanguages:
57-
- eng
57+
- en

testdata/v0/invalid/description_eng_awards_wrong_type.yml testdata/v0/invalid/description_en_awards_wrong_type.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ developmentStatus: development
1616
softwareType: "standalone/other"
1717

1818
description:
19-
eng:
19+
en:
2020
localisedName: Name
2121
shortDescription: >
2222
A rather short description which
@@ -51,4 +51,4 @@ maintenance:
5151
localisation:
5252
localisationReady: true
5353
availableLanguages:
54-
- eng
54+
- en

testdata/v0/invalid/description_eng_documentation_invalid.yml testdata/v0/invalid/description_en_documentation_invalid.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ developmentStatus: development
1818
softwareType: "standalone/other"
1919

2020
description:
21-
eng:
21+
en:
2222
localisedName: Medusa
2323

2424
# Should NOT validate: must be a valid URL
@@ -55,4 +55,4 @@ maintenance:
5555
localisation:
5656
localisationReady: true
5757
availableLanguages:
58-
- eng
58+
- en

testdata/v0/invalid/description_eng_documentation_wrong_type.yml testdata/v0/invalid/description_en_documentation_wrong_type.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ developmentStatus: development
1818
softwareType: "standalone/other"
1919

2020
description:
21-
eng:
21+
en:
2222
localisedName: Medusa
2323

2424
# Should NOT validate: documentation must be a string
@@ -55,4 +55,4 @@ maintenance:
5555
localisation:
5656
localisationReady: true
5757
availableLanguages:
58-
- eng
58+
- en

testdata/v0/invalid/description_eng_features_empty.yml testdata/v0/invalid/description_en_features_empty.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ developmentStatus: development
1616
softwareType: "standalone/other"
1717

1818
description:
19-
eng:
19+
en:
2020
localisedName: Medusa
2121
shortDescription: >
2222
A rather short description which
@@ -50,4 +50,4 @@ maintenance:
5050
localisation:
5151
localisationReady: true
5252
availableLanguages:
53-
- eng
53+
- en

testdata/v0/invalid/description_eng_features_missing.yml testdata/v0/invalid/description_en_features_missing.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ developmentStatus: development
1616
softwareType: "standalone/other"
1717

1818
description:
19-
eng:
19+
en:
2020
# Should NOT validate: features is missing
2121
# features: []
2222
localisedName: Medusa
@@ -49,4 +49,4 @@ maintenance:
4949
localisation:
5050
localisationReady: true
5151
availableLanguages:
52-
- eng
52+
- en

0 commit comments

Comments
 (0)