(t *testing.T)
| 1643 | } |
| 1644 | |
| 1645 | func TestCredentialPatternFromGitURL(t *testing.T) { |
| 1646 | // Given a well-formed HTTPS Git URL |
| 1647 | gitURL := "https://github.com/OWNER/REPO.git" |
| 1648 | |
| 1649 | // When its credential scope is derived |
| 1650 | credentialPattern, err := CredentialPatternFromGitURL(gitURL) |
| 1651 | |
| 1652 | // Then credentials are scoped to the URL's HTTPS host |
| 1653 | require.NoError(t, err) |
| 1654 | assert.Equal(t, CredentialPattern{pattern: "https://github.com"}, credentialPattern) |
| 1655 | } |
| 1656 | |
| 1657 | func TestCredentialPatternFromGitURLReportsMalformedURL(t *testing.T) { |
| 1658 | // Given a Git URL with a malformed bracketed host |
nothing calls this directly
no test coverage detected