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