MCPcopy Create free account
hub / github.com/cli/cli / TestCredentialPatternFromGitURLReportsMalformedURL

Function TestCredentialPatternFromGitURLReportsMalformedURL

git/client_test.go:1657–1667  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1655}
1656
1657func 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
1669func TestCredentialPatternFromHost(t *testing.T) {
1670 // Given a Git host

Callers

nothing calls this directly

Calls 2

EmptyMethod · 0.80

Tested by

no test coverage detected