-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathbindings_test.go
More file actions
40 lines (30 loc) · 949 Bytes
/
bindings_test.go
File metadata and controls
40 lines (30 loc) · 949 Bytes
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
package duckdb_go_bindings
import (
"testing"
"github.com/stretchr/testify/require"
)
// TestVectorSize ensures that linking works.
func TestVectorSize(t *testing.T) {
defer VerifyAllocationCounters()
require.Equal(t, IdxT(2048), VectorSize())
}
// TestCreateDataChunk ensures that we allocate C arrays correctly.
func TestCreateDataChunk(t *testing.T) {
defer VerifyAllocationCounters()
tinyIntT := CreateLogicalType(TypeTinyInt)
defer DestroyLogicalType(&tinyIntT)
varcharT := CreateLogicalType(TypeVarchar)
defer DestroyLogicalType(&varcharT)
var types []LogicalType
types = append(types, tinyIntT, varcharT)
structT := CreateStructType(types, []string{"c1", "c2"})
defer DestroyLogicalType(&structT)
types = append(types, structT)
chunk := CreateDataChunk(types)
defer DestroyDataChunk(&chunk)
}
func TestLibraryVersion(t *testing.T) {
defer VerifyAllocationCounters()
v := LibraryVersion()
require.NotEmpty(t, v)
}