Skip to content

Commit

Permalink
test: add disabled test for BCP47 tag
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bfabio committed Mar 23, 2022
1 parent 1370eb5 commit f1fe87f
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
6 changes: 6 additions & 0 deletions parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,12 @@ func TestInvalidTestcasesV0_2(t *testing.T) {
"localisation_availableLanguages_invalid.yml": ValidationErrors{
ValidationError{"localisation.availableLanguages[0]", "must be a valid BCP 47 language", 56, 3},
},
// TODO: Enable this test when https://github.com/italia/publiccode-parser-go/issues/47
// is fixed
//
// "localisation_availableLanguages_invalid_bcp47.yml": ValidationErrors{
// ValidationError{"localisation.availableLanguages[0]", "must be a valid BCP 47 language", 56, 3},
// },
"localisation_localisationReady_missing.yml": ValidationErrors{
ValidationError{"localisation.localisationReady", "required", 58, 3},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
publiccodeYmlVersion: "0.2"

name: Medusa
url: "https://github.com/italia/developers.italia.it.git"
softwareVersion: "dev"
releaseDate: "2017-04-15"

inputTypes:
- application/x.empty
outputTypes:
- application/x.empty

platforms:
- web

categories:
- cloud-management

developmentStatus: development

softwareType: "standalone/other"

description:
eng:
localisedName: Medusa
genericName: Text Editor
shortDescription: >
A rather short description which
is probably useless
longDescription: >
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 158 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 316 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 474 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 632 characters.
features:
- Just one feature

legal:
license: AGPL-3.0-or-later

maintenance:
type: "community"

contacts:
- name: Francesco Rossi

localisation:
localisationReady: true
availableLanguages:
# Should NOT validate: even if this a valid POSIX language tag
# it's NOT a valid BCP47 language tag
- hr_HR

0 comments on commit f1fe87f

Please sign in to comment.