(t *testing.T)
| 153 | } |
| 154 | |
| 155 | func TestGetStringHash(t *testing.T) { |
| 156 | type test struct { |
| 157 | input string |
| 158 | expected string |
| 159 | } |
| 160 | |
| 161 | testcases := []test{ |
| 162 | { |
| 163 | input: "2269c984-db9a-4b0e-9fd5-86df0ad269f7", |
| 164 | expected: "7c6d7bd86b", |
| 165 | }, |
| 166 | { |
| 167 | input: "2269c984-db9a-4b0e-9fd5-86df0ad269f7-5.15.0-1041-azure", |
| 168 | expected: "79d6bd954f", |
| 169 | }, |
| 170 | { |
| 171 | input: "2269c984-db9a-4b0e-9fd5-86df0ad269f7-rhcos4.14-414.92.202309282257", |
| 172 | expected: "646cdfdb96", |
| 173 | }, |
| 174 | { |
| 175 | input: "rhcos4.14-414.92.202309282257", |
| 176 | expected: "5bbdb464cb", |
| 177 | }, |
| 178 | { |
| 179 | input: "nvidia-gpu-driver-2269c984-db9a-4b0e-9fd5-86df0ad269f7-rhcos4.14-414.92.202309282257", |
| 180 | expected: "7bf6859b6d", |
| 181 | }, |
| 182 | { |
| 183 | input: "nvidia-vgpu-driver-2269c984-db9a-4b0e-9fd5-868df0ad269f7-rhcos4.14-414.92.202309282257", |
| 184 | expected: "7469f59898", |
| 185 | }, |
| 186 | } |
| 187 | |
| 188 | for _, tc := range testcases { |
| 189 | actual := GetStringHash(tc.input) |
| 190 | assert.Equal(t, tc.expected, actual) |
| 191 | } |
| 192 | } |
nothing calls this directly
no test coverage detected