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

Function TestCredentialPatternFromHost

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

Source from the content-addressed store, hash-verified

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