| 158 | } |
| 159 | |
| 160 | func comprareOptions(t *testing.T, actual, expected *Options) { |
| 161 | t.Helper() |
| 162 | |
| 163 | if actual.Addr != expected.Addr { |
| 164 | t.Errorf("got %q, want %q", actual.Addr, expected.Addr) |
| 165 | } |
| 166 | if actual.DB != expected.DB { |
| 167 | t.Errorf("DB: got %q, expected %q", actual.DB, expected.DB) |
| 168 | } |
| 169 | if actual.TLSConfig == nil && expected.TLSConfig != nil { |
| 170 | t.Errorf("got nil TLSConfig, expected a TLSConfig") |
| 171 | } |
| 172 | if actual.TLSConfig != nil && expected.TLSConfig == nil { |
| 173 | t.Errorf("got TLSConfig, expected no TLSConfig") |
| 174 | } |
| 175 | if actual.Username != expected.Username { |
| 176 | t.Errorf("Username: got %q, expected %q", actual.Username, expected.Username) |
| 177 | } |
| 178 | if actual.Password != expected.Password { |
| 179 | t.Errorf("Password: got %q, expected %q", actual.Password, expected.Password) |
| 180 | } |
| 181 | if actual.MaxRetries != expected.MaxRetries { |
| 182 | t.Errorf("MaxRetries: got %v, expected %v", actual.MaxRetries, expected.MaxRetries) |
| 183 | } |
| 184 | if actual.MinRetryBackoff != expected.MinRetryBackoff { |
| 185 | t.Errorf("MinRetryBackoff: got %v, expected %v", actual.MinRetryBackoff, expected.MinRetryBackoff) |
| 186 | } |
| 187 | if actual.MaxRetryBackoff != expected.MaxRetryBackoff { |
| 188 | t.Errorf("MaxRetryBackoff: got %v, expected %v", actual.MaxRetryBackoff, expected.MaxRetryBackoff) |
| 189 | } |
| 190 | if actual.DialTimeout != expected.DialTimeout { |
| 191 | t.Errorf("DialTimeout: got %v, expected %v", actual.DialTimeout, expected.DialTimeout) |
| 192 | } |
| 193 | if actual.ReadTimeout != expected.ReadTimeout { |
| 194 | t.Errorf("ReadTimeout: got %v, expected %v", actual.ReadTimeout, expected.ReadTimeout) |
| 195 | } |
| 196 | if actual.WriteTimeout != expected.WriteTimeout { |
| 197 | t.Errorf("WriteTimeout: got %v, expected %v", actual.WriteTimeout, expected.WriteTimeout) |
| 198 | } |
| 199 | if actual.PoolFIFO != expected.PoolFIFO { |
| 200 | t.Errorf("PoolFIFO: got %v, expected %v", actual.PoolFIFO, expected.PoolFIFO) |
| 201 | } |
| 202 | if actual.PoolSize != expected.PoolSize { |
| 203 | t.Errorf("PoolSize: got %v, expected %v", actual.PoolSize, expected.PoolSize) |
| 204 | } |
| 205 | if actual.PoolTimeout != expected.PoolTimeout { |
| 206 | t.Errorf("PoolTimeout: got %v, expected %v", actual.PoolTimeout, expected.PoolTimeout) |
| 207 | } |
| 208 | if actual.MinIdleConns != expected.MinIdleConns { |
| 209 | t.Errorf("MinIdleConns: got %v, expected %v", actual.MinIdleConns, expected.MinIdleConns) |
| 210 | } |
| 211 | if actual.MaxIdleConns != expected.MaxIdleConns { |
| 212 | t.Errorf("MaxIdleConns: got %v, expected %v", actual.MaxIdleConns, expected.MaxIdleConns) |
| 213 | } |
| 214 | if actual.ConnMaxIdleTime != expected.ConnMaxIdleTime { |
| 215 | t.Errorf("ConnMaxIdleTime: got %v, expected %v", actual.ConnMaxIdleTime, expected.ConnMaxIdleTime) |
| 216 | } |
| 217 | if actual.ConnMaxLifetime != expected.ConnMaxLifetime { |