stop using xorm.io/core

This commit is contained in:
Tomoya AMACHI 2020-03-23 05:18:18 +09:00
parent 5d32cb3a3f
commit b767765633
No known key found for this signature in database
GPG Key ID: F37EC01B0043942F
2 changed files with 5 additions and 7 deletions

View File

@ -842,7 +842,7 @@ func (p *oci8Driver) Parse(driverName, dataSourceName string) (*URI, error) {
db.DBName = match
}
}
if db.DbName == "" && len(matches) != 0 {
if db.DBName == "" && len(matches) != 0 {
return nil, errors.New("dbname is empty")
}
return db, nil

View File

@ -1,10 +1,8 @@
package xorm
package dialects
import (
"reflect"
"testing"
"xorm.io/core"
)
func TestParseOracleConnStr(t *testing.T) {
@ -21,15 +19,15 @@ func TestParseOracleConnStr(t *testing.T) {
{"user/pass", "", false},
{"", "", false},
}
driver := core.QueryDriver("oci8")
driver := QueryDriver("oci8")
for _, test := range tests {
t.Run(test.in, func(t *testing.T) {
driver := driver
uri, err := driver.Parse("oci8", test.in)
if err != nil && test.valid {
t.Errorf("%q got unexpected error: %s", test.in, err)
} else if err == nil && !reflect.DeepEqual(test.expected, uri.DbName) {
t.Errorf("%q got: %#v want: %#v", test.in, uri.DbName, test.expected)
} else if err == nil && !reflect.DeepEqual(test.expected, uri.DBName) {
t.Errorf("%q got: %#v want: %#v", test.in, uri.DBName, test.expected)
}
})
}