forked from denisenkom/go-mssqldb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types_test.go
28 lines (26 loc) · 952 Bytes
/
types_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package mssql
import (
"testing"
"reflect"
"time"
)
func TestMakeGoLangScanType(t *testing.T) {
if (reflect.TypeOf(int64(0)) != makeGoLangScanType(typeInfo{TypeId: typeInt8})) {
t.Errorf("invalid type returned for typeDateTime")
}
if (reflect.TypeOf(float64(0)) != makeGoLangScanType(typeInfo{TypeId: typeFlt4})) {
t.Errorf("invalid type returned for typeDateTime")
}
if (reflect.TypeOf(float64(0)) != makeGoLangScanType(typeInfo{TypeId: typeFlt8})) {
t.Errorf("invalid type returned for typeDateTime")
}
if (reflect.TypeOf("") != makeGoLangScanType(typeInfo{TypeId: typeVarChar})) {
t.Errorf("invalid type returned for typeDateTime")
}
if (reflect.TypeOf(time.Time{}) != makeGoLangScanType(typeInfo{TypeId: typeDateTime})) {
t.Errorf("invalid type returned for typeDateTime")
}
if (reflect.TypeOf(time.Time{}) != makeGoLangScanType(typeInfo{TypeId: typeDateTim4})) {
t.Errorf("invalid type returned for typeDateTim4")
}
}