|
1 | 1 | // This Source Code Form is subject to the terms of the Mozilla Public |
2 | 2 | // License, v. 2.0. If a copy of the MPL was not distributed with this |
3 | 3 | // file, You can obtain one at https://mozilla.org/MPL/2.0/. |
| 4 | + |
4 | 5 | package provider |
5 | 6 |
|
6 | 7 | import ( |
@@ -31,11 +32,20 @@ func TestInstanceIDFromProviderID(t *testing.T) { |
31 | 32 | t.Run(tc.name, func(t *testing.T) { |
32 | 33 | result, err := InstanceIDFromProviderID(tc.providerID) |
33 | 34 | if err != nil { |
34 | | - t.Errorf("TestInstanceIDFromProviderID(%s) returned non-nil error %v, want nil error", tc.providerID, err) |
| 35 | + t.Errorf( |
| 36 | + "TestInstanceIDFromProviderID(%s) returned non-nil error %v, want nil error", |
| 37 | + tc.providerID, |
| 38 | + err, |
| 39 | + ) |
35 | 40 | } |
36 | 41 |
|
37 | 42 | if result != tc.expected { |
38 | | - t.Errorf("TestInstanceIDFromProviderID(%s) returned %s, want %s", tc.providerID, result, tc.expected) |
| 43 | + t.Errorf( |
| 44 | + "TestInstanceIDFromProviderID(%s) returned %s, want %s", |
| 45 | + tc.providerID, |
| 46 | + result, |
| 47 | + tc.expected, |
| 48 | + ) |
39 | 49 | } |
40 | 50 | }) |
41 | 51 | } |
@@ -83,11 +93,19 @@ func TestInstanceIDFromProviderID(t *testing.T) { |
83 | 93 | t.Run(tc.name, func(t *testing.T) { |
84 | 94 | _, err := InstanceIDFromProviderID(tc.providerID) |
85 | 95 | if err == nil { |
86 | | - t.Errorf("TestInstanceIDFromProviderID(%s) returned nil error, want non-nil error", tc.providerID) |
| 96 | + t.Errorf( |
| 97 | + "TestInstanceIDFromProviderID(%s) returned nil error, want non-nil error", |
| 98 | + tc.providerID, |
| 99 | + ) |
87 | 100 | } |
88 | 101 |
|
89 | 102 | if !strings.Contains(err.Error(), tc.errorMsg) { |
90 | | - t.Errorf("TestInstanceIDFromProviderID(%s) returned error %v, want %s", tc.providerID, err.Error(), tc.errorMsg) |
| 103 | + t.Errorf( |
| 104 | + "TestInstanceIDFromProviderID(%s) returned error %v, want %s", |
| 105 | + tc.providerID, |
| 106 | + err.Error(), |
| 107 | + tc.errorMsg, |
| 108 | + ) |
91 | 109 | } |
92 | 110 | }) |
93 | 111 | } |
|
0 commit comments