forked from src-d/gitbase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblobs_test.go
43 lines (32 loc) · 896 Bytes
/
blobs_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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package gitquery
import (
"testing"
"gopkg.in/sqle/sqle.v0/sql"
"github.com/src-d/go-git-fixtures"
"github.com/stretchr/testify/assert"
)
func TestBlobsTable_Name(t *testing.T) {
assert := assert.New(t)
f := fixtures.Basic().One()
table := getTable(assert, f, blobsTableName)
assert.Equal(blobsTableName, table.Name())
}
func TestBlobsTable_Children(t *testing.T) {
assert := assert.New(t)
f := fixtures.Basic().One()
table := getTable(assert, f, blobsTableName)
assert.Equal(0, len(table.Children()))
}
func TestBlobsTable_RowIter(t *testing.T) {
assert := assert.New(t)
f := fixtures.Basic().One()
table := getTable(assert, f, blobsTableName)
rows, err := sql.NodeToRows(table)
assert.Nil(err)
assert.Len(rows, 10)
schema := table.Schema()
for idx, row := range rows {
err := schema.CheckRow(row)
assert.Nil(err, "row %d doesn't conform to schema", idx)
}
}