(t *testing.T)
| 2075 | } |
| 2076 | |
| 2077 | func 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 | |
| 2100 | func TestPushDefault(t *testing.T) { |
| 2101 | t.Run("it parses valid values correctly", func(t *testing.T) { |
nothing calls this directly
no test coverage detected