| 1 | package mssql |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | "reflect" |
| 6 | "time" |
| 7 | ) |
| 8 | |
| 9 | func TestMakeGoLangScanType(t *testing.T) { |
| 10 | if (reflect.TypeOf(int64(0)) != makeGoLangScanType(typeInfo{TypeId: typeInt8})) { |
| 11 | t.Errorf("invalid type returned for typeDateTime") |
| 12 | } |
| 13 | if (reflect.TypeOf(float64(0)) != makeGoLangScanType(typeInfo{TypeId: typeFlt4})) { |
| 14 | t.Errorf("invalid type returned for typeDateTime") |
| 15 | } |
| 16 | if (reflect.TypeOf(float64(0)) != makeGoLangScanType(typeInfo{TypeId: typeFlt8})) { |
| 17 | t.Errorf("invalid type returned for typeDateTime") |
| 18 | } |
| 19 | if (reflect.TypeOf("") != makeGoLangScanType(typeInfo{TypeId: typeVarChar})) { |
| 20 | t.Errorf("invalid type returned for typeDateTime") |
| 21 | } |
| 22 | if (reflect.TypeOf(time.Time{}) != makeGoLangScanType(typeInfo{TypeId: typeDateTime})) { |
| 23 | t.Errorf("invalid type returned for typeDateTime") |
| 24 | } |
| 25 | if (reflect.TypeOf(time.Time{}) != makeGoLangScanType(typeInfo{TypeId: typeDateTim4})) { |
| 26 | t.Errorf("invalid type returned for typeDateTim4") |
| 27 | } |
| 28 | } |