(t *testing.T)
| 27 | ) |
| 28 | |
| 29 | func TestRowsStructure(t *testing.T) { |
| 30 | Convey("test rows", t, func() { |
| 31 | r := newRows(&types.Response{ |
| 32 | Payload: types.ResponsePayload{ |
| 33 | Columns: []string{ |
| 34 | "a", |
| 35 | }, |
| 36 | DeclTypes: []string{ |
| 37 | "int", |
| 38 | }, |
| 39 | Rows: []types.ResponseRow{ |
| 40 | { |
| 41 | Values: []interface{}{1}, |
| 42 | }, |
| 43 | }, |
| 44 | }, |
| 45 | }) |
| 46 | columns := r.Columns() |
| 47 | So(columns, ShouldResemble, []string{"a"}) |
| 48 | So(r.ColumnTypeDatabaseTypeName(0), ShouldEqual, "INT") |
| 49 | |
| 50 | dest := make([]driver.Value, 1) |
| 51 | err := r.Next(dest) |
| 52 | So(err, ShouldBeNil) |
| 53 | So(dest[0], ShouldEqual, 1) |
| 54 | err = r.Next(dest) |
| 55 | So(err, ShouldEqual, io.EOF) |
| 56 | err = r.Close() |
| 57 | So(err, ShouldBeNil) |
| 58 | So(r.data, ShouldBeNil) |
| 59 | }) |
| 60 | } |
nothing calls this directly
no test coverage detected