From 2fa7c464f019f67c5c0494aaf5ac0f5ecc1ee7a7 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Tue, 16 Jan 2018 12:03:31 -0500 Subject: Updated dependencies and added avct/uasurfer (#8089) * Updated dependencies and added avct/uasurfer * Added uasurfer to NOTICE.txt --- vendor/golang.org/x/text/language/language_test.go | 41 +++++++++++++++++++--- 1 file changed, 37 insertions(+), 4 deletions(-) (limited to 'vendor/golang.org/x/text/language/language_test.go') diff --git a/vendor/golang.org/x/text/language/language_test.go b/vendor/golang.org/x/text/language/language_test.go index f7c2d88ab..9e42d15dc 100644 --- a/vendor/golang.org/x/text/language/language_test.go +++ b/vendor/golang.org/x/text/language/language_test.go @@ -91,11 +91,11 @@ func TestCompactIndex(t *testing.T) { {"ca-ES-valencia-u-co-phonebk", 1, true}, {"ca-ES-valencia-u-co-phonebk-va-posix", 0, false}, {"x-klingon", 0, false}, - {"en-US", 229, true}, + {"en-US", 232, true}, {"en-US-u-va-posix", 2, true}, - {"en", 133, true}, - {"en-u-co-phonebk", 133, true}, - {"en-001", 134, true}, + {"en", 136, true}, + {"en-u-co-phonebk", 136, true}, + {"en-001", 137, true}, {"sh", 0, false}, // We don't normalize. } for _, tt := range tests { @@ -106,6 +106,39 @@ func TestCompactIndex(t *testing.T) { } } +func TestMarshal(t *testing.T) { + testCases := []string{ + // TODO: these values will change with each CLDR update. This issue + // will be solved if we decide to fix the indexes. + "und", + "ca-ES-valencia", + "ca-ES-valencia-u-va-posix", + "ca-ES-valencia-u-co-phonebk", + "ca-ES-valencia-u-co-phonebk-va-posix", + "x-klingon", + "en-US", + "en-US-u-va-posix", + "en", + "en-u-co-phonebk", + "en-001", + "sh", + } + for _, tc := range testCases { + var tag Tag + err := tag.UnmarshalText([]byte(tc)) + if err != nil { + t.Errorf("UnmarshalText(%q): unexpected error: %v", tc, err) + } + b, err := tag.MarshalText() + if err != nil { + t.Errorf("MarshalText(%q): unexpected error: %v", tc, err) + } + if got := string(b); got != tc { + t.Errorf("%s: got %q; want %q", tc, got, tc) + } + } +} + func TestBase(t *testing.T) { tests := []struct { loc, lang string -- cgit v1.2.3-1-g7c22