(t *testing.T)
| 229 | } |
| 230 | |
| 231 | func TestReferenceNormalizeName(t *testing.T) { |
| 232 | t.Parallel() |
| 233 | |
| 234 | ref, err := ReferenceNormalizeName("refs/heads//master", ReferenceFormatNormal) |
| 235 | checkFatal(t, err) |
| 236 | |
| 237 | if ref != "refs/heads/master" { |
| 238 | t.Errorf("ReferenceNormalizeName(%q) = %q; want %q", "refs/heads//master", ref, "refs/heads/master") |
| 239 | } |
| 240 | |
| 241 | ref, err = ReferenceNormalizeName("master", ReferenceFormatAllowOnelevel|ReferenceFormatRefspecShorthand) |
| 242 | checkFatal(t, err) |
| 243 | |
| 244 | if ref != "master" { |
| 245 | t.Errorf("ReferenceNormalizeName(%q) = %q; want %q", "master", ref, "master") |
| 246 | } |
| 247 | |
| 248 | ref, err = ReferenceNormalizeName("foo^", ReferenceFormatNormal) |
| 249 | if !IsErrorCode(err, ErrorCodeInvalidSpec) { |
| 250 | t.Errorf("foo^ should be invalid") |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | func compareStringList(t *testing.T, expected, actual []string) { |
| 255 | for i, v := range expected { |
nothing calls this directly
no test coverage detected
searching dependent graphs…