(t *testing.T)
| 1655 | } |
| 1656 | |
| 1657 | func TestCredentialPatternFromGitURLReportsMalformedURL(t *testing.T) { |
| 1658 | // Given a Git URL with a malformed bracketed host |
| 1659 | gitURL := "ssh://git@[/tmp/git-repo" |
| 1660 | |
| 1661 | // When its credential scope is derived |
| 1662 | credentialPattern, err := CredentialPatternFromGitURL(gitURL) |
| 1663 | |
| 1664 | // Then the URL parsing failure is reported with context |
| 1665 | require.ErrorContains(t, err, "failed to parse remote URL") |
| 1666 | assert.Empty(t, credentialPattern) |
| 1667 | } |
| 1668 | |
| 1669 | func TestCredentialPatternFromHost(t *testing.T) { |
| 1670 | // Given a Git host |
nothing calls this directly
no test coverage detected