This commit is contained in:
Lunny Xiao 2019-09-22 23:13:55 +08:00 committed by GitHub
parent 57a7e4421e
commit d4419ac496
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -4,9 +4,8 @@ import (
"reflect" "reflect"
"testing" "testing"
"xorm.io/core"
"github.com/jackc/pgx/stdlib"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"xorm.io/core"
) )
func TestParsePostgres(t *testing.T) { func TestParsePostgres(t *testing.T) {
@ -72,10 +71,7 @@ func TestParsePgx(t *testing.T) {
} }
// Register DriverConfig // Register DriverConfig
drvierConfig := stdlib.DriverConfig{} uri, err = driver.Parse("pgx", test.in)
stdlib.RegisterDriverConfig(&drvierConfig)
uri, err = driver.Parse("pgx",
drvierConfig.ConnectionString(test.in))
if err != nil && test.valid { if err != nil && test.valid {
t.Errorf("%q got unexpected error: %s", test.in, err) t.Errorf("%q got unexpected error: %s", test.in, err)
} else if err == nil && !reflect.DeepEqual(test.expected, uri.DbName) { } else if err == nil && !reflect.DeepEqual(test.expected, uri.DbName) {