Skip to content

Commit 2f12edb

Browse files
authored
test: update remote fixture expectation after fix #47 merged (#326)
1 parent 915b968 commit 2f12edb

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

v0_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -655,13 +655,7 @@ func TestValidWithWarningsTestcasesV0(t *testing.T) {
655655
// Test publiccode.yml remote files for key errors.
656656
func TestDecodeValueErrorsRemote(t *testing.T) {
657657
testRemoteFiles := []testType{
658-
// NOTE: The remote file still uses 3-letter language codes (ita, fra, deu) which are
659-
// rejected by the strict BCP47 validator. Once the remote fixture is updated to use
660-
// 2-letter codes (it, fr, de) the ValidationErrors below can be removed.
661658
{"https://raw.githubusercontent.com/italia/publiccode-parser-go/refs/heads/main/testdata/v0/valid_with_warnings/valid_with_lowercase_countries.yml", ValidationResults{
662-
ValidationError{"localisation.availableLanguages[1]", "availableLanguages[1] must be a valid BCP 47 language", 94, 3},
663-
ValidationError{"localisation.availableLanguages[2]", "availableLanguages[2] must be a valid BCP 47 language", 94, 3},
664-
ValidationError{"localisation.availableLanguages[3]", "availableLanguages[3] must be a valid BCP 47 language", 94, 3},
665659
ValidationWarning{"intendedAudience.countries[0]", "Lowercase country codes are DEPRECATED. Use uppercase instead ('IT')", 30, 3},
666660
ValidationWarning{"intendedAudience.countries[1]", "Lowercase country codes are DEPRECATED. Use uppercase instead ('DE')", 30, 3},
667661
ValidationWarning{"intendedAudience.unsupportedCountries[0]", "Lowercase country codes are DEPRECATED. Use uppercase instead ('US')", 30, 3},

validators/bcp47.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313
// isBCP47StrictLanguageTag validates a BCP 47 language tag according to
1414
// https://www.rfc-editor.org/rfc/bcp/bcp47.txt, rejecting POSIX-style tags
1515
// (e.g. en_GB) and Unicode extensions unlike the built-in bcp47_language_tag.
16+
//
17+
// From https://github.com/go-playground/validator/pull/1489/.
1618
func isBCP47StrictLanguageTag(fl validator.FieldLevel) bool {
1719
field := fl.Field()
1820

0 commit comments

Comments
 (0)