(t *testing.T)
| 2078 | } |
| 2079 | |
| 2080 | func 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 | |
| 2103 | func TestPushDefault(t *testing.T) { |
| 2104 | t.Run("it parses valid values correctly", func(t *testing.T) { |
nothing calls this directly
no test coverage detected