diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2018-01-16 12:03:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-16 12:03:31 -0500 |
commit | 2fa7c464f019f67c5c0494aaf5ac0f5ecc1ee7a7 (patch) | |
tree | e08ff912e1924c06939f314168c3362d6f1ec0de /vendor/golang.org/x/text/message/fmt_test.go | |
parent | f5c8a71698d0a7a16c68be220e49fe64bfee7f5c (diff) | |
download | chat-2fa7c464f019f67c5c0494aaf5ac0f5ecc1ee7a7.tar.gz chat-2fa7c464f019f67c5c0494aaf5ac0f5ecc1ee7a7.tar.bz2 chat-2fa7c464f019f67c5c0494aaf5ac0f5ecc1ee7a7.zip |
Updated dependencies and added avct/uasurfer (#8089)
* Updated dependencies and added avct/uasurfer
* Added uasurfer to NOTICE.txt
Diffstat (limited to 'vendor/golang.org/x/text/message/fmt_test.go')
-rw-r--r--[-rwxr-xr-x] | vendor/golang.org/x/text/message/fmt_test.go | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/vendor/golang.org/x/text/message/fmt_test.go b/vendor/golang.org/x/text/message/fmt_test.go index 2110bb532..2d6872bf8 100755..100644 --- a/vendor/golang.org/x/text/message/fmt_test.go +++ b/vendor/golang.org/x/text/message/fmt_test.go @@ -1786,7 +1786,12 @@ func TestNilDoesNotBecomeTyped(t *testing.T) { type B struct{} var a *A = nil var b B = B{} - got := p.Sprintf("%s %s %s %s %s", nil, a, nil, b, nil) // go vet should complain about this line. + + // indirect the Sprintf call through this noVetWarn variable to avoid + // "go test" failing vet checks in Go 1.10+. + noVetWarn := p.Sprintf + got := noVetWarn("%s %s %s %s %s", nil, a, nil, b, nil) + const expect = "%!s(<nil>) %!s(*message.A=<nil>) %!s(<nil>) {} %!s(<nil>)" if got != expect { t.Errorf("expected:\n\t%q\ngot:\n\t%q", expect, got) @@ -1864,26 +1869,3 @@ func TestFormatterFlags(t *testing.T) { } } } - -func TestParsenum(t *testing.T) { - testCases := []struct { - s string - start, end int - num int - isnum bool - newi int - }{ - {"a123", 0, 4, 0, false, 0}, - {"1234", 1, 1, 0, false, 1}, - {"123a", 0, 4, 123, true, 3}, - {"12a3", 0, 4, 12, true, 2}, - {"1234", 0, 4, 1234, true, 4}, - {"1a234", 1, 3, 0, false, 1}, - } - for _, tt := range testCases { - num, isnum, newi := parsenum(tt.s, tt.start, tt.end) - if num != tt.num || isnum != tt.isnum || newi != tt.newi { - t.Errorf("parsenum(%q, %d, %d) = %d, %v, %d, want %d, %v, %d", tt.s, tt.start, tt.end, num, isnum, newi, tt.num, tt.isnum, tt.newi) - } - } -} |