MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / TestRowsStructure

Function TestRowsStructure

client/rows_test.go:29–60  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

27)
28
29func 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}

Callers

nothing calls this directly

Calls 5

newRowsFunction · 0.85
CloseMethod · 0.65
ColumnsMethod · 0.45
NextMethod · 0.45

Tested by

no test coverage detected