MCPcopy Index your code
hub / github.com/cli/cli / TestCredentialPatternFromHost

Function TestCredentialPatternFromHost

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

Source from the content-addressed store, hash-verified

2075}
2076
2077func TestCredentialPatternFromHost(t *testing.T) {
2078 tests := []struct {
2079 name string
2080 host string
2081 wantCredentialPattern CredentialPattern
2082 }{
2083 {
2084 name: "Given a well formed host, it returns the corresponding CredentialPattern",
2085 host: "github.com",
2086 wantCredentialPattern: CredentialPattern{
2087 pattern: "https://github.com",
2088 allMatching: false,
2089 },
2090 },
2091 }
2092 for _, tt := range tests {
2093 t.Run(tt.name, func(t *testing.T) {
2094 credentialPattern := CredentialPatternFromHost(tt.host)
2095 require.Equal(t, tt.wantCredentialPattern, credentialPattern)
2096 })
2097 }
2098}
2099
2100func TestPushDefault(t *testing.T) {
2101 t.Run("it parses valid values correctly", func(t *testing.T) {

Callers

nothing calls this directly

Calls 3

EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected