mirror of
https://github.com/docker/docker-credential-helpers.git
synced 2026-06-13 16:01:28 +05:30
use "tc" for test-cases
Mostly for my own sanity; just about every repository we have started to converge to using "tc" as variable name for this, so updating this repository as well to help reduce cognitive load. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
+10
-10
@@ -24,23 +24,23 @@ func TestHelperParseURL(t *testing.T) {
|
||||
{url: "ftp://foobar.docker.io:2376", err: errors.New("unsupported scheme: ftp")},
|
||||
}
|
||||
|
||||
for _, te := range tests {
|
||||
u, err := Parse(te.url)
|
||||
for _, tc := range tests {
|
||||
u, err := Parse(tc.url)
|
||||
|
||||
if te.err == nil && err != nil {
|
||||
t.Errorf("Error: failed to parse URL %q: %s", te.url, err)
|
||||
if tc.err == nil && err != nil {
|
||||
t.Errorf("Error: failed to parse URL %q: %s", tc.url, err)
|
||||
continue
|
||||
}
|
||||
if te.err != nil && err == nil {
|
||||
t.Errorf("Error: expected error %q, got none when parsing URL %q", te.err, te.url)
|
||||
if tc.err != nil && err == nil {
|
||||
t.Errorf("Error: expected error %q, got none when parsing URL %q", tc.err, tc.url)
|
||||
continue
|
||||
}
|
||||
if te.err != nil && err.Error() != te.err.Error() {
|
||||
t.Errorf("Error: expected error %q, got %q when parsing URL %q", te.err, err, te.url)
|
||||
if tc.err != nil && err.Error() != tc.err.Error() {
|
||||
t.Errorf("Error: expected error %q, got %q when parsing URL %q", tc.err, err, tc.url)
|
||||
continue
|
||||
}
|
||||
if u != nil && u.String() != te.expectedURL {
|
||||
t.Errorf("Error: expected URL: %q, but got %q for URL: %q", te.expectedURL, u.String(), te.url)
|
||||
if u != nil && u.String() != tc.expectedURL {
|
||||
t.Errorf("Error: expected URL: %q, but got %q for URL: %q", tc.expectedURL, u.String(), tc.url)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user