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 db.DBName = match
} }
} }
if db.DbName == "" && len(matches) != 0 { if db.DBName == "" && len(matches) != 0 {
return nil, errors.New("dbname is empty") return nil, errors.New("dbname is empty")
} }
return db, nil return db, nil

View File

@ -1,10 +1,8 @@
package xorm package dialects
import ( import (
"reflect" "reflect"
"testing" "testing"
"xorm.io/core"
) )
func TestParseOracleConnStr(t *testing.T) { func TestParseOracleConnStr(t *testing.T) {
@ -21,15 +19,15 @@ func TestParseOracleConnStr(t *testing.T) {
{"user/pass", "", false}, {"user/pass", "", false},
{"", "", false}, {"", "", false},
} }
driver := core.QueryDriver("oci8") driver := QueryDriver("oci8")
for _, test := range tests { for _, test := range tests {
t.Run(test.in, func(t *testing.T) { t.Run(test.in, func(t *testing.T) {
driver := driver driver := driver
uri, err := driver.Parse("oci8", test.in) uri, err := driver.Parse("oci8", 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) {
t.Errorf("%q got: %#v want: %#v", test.in, uri.DbName, test.expected) t.Errorf("%q got: %#v want: %#v", test.in, uri.DBName, test.expected)
} }
}) })
} }