forked from parquet-go/parquet-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_test.go
47 lines (44 loc) · 878 Bytes
/
config_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
44
45
46
47
package parquet
import (
"os"
"reflect"
"testing"
)
func TestConfig(t *testing.T) {
type RowType struct {
Id string
FirstName string
LastName string
}
tcs := []struct {
name string
cfg *WriterConfig
}{
{
name: "Check MaxRowsPerRowGroup Coalesces",
cfg: func() *WriterConfig {
conf := DefaultWriterConfig()
conf.MaxRowsPerRowGroup = 10
return conf
}(),
},
{
name: "Check DataPageStatistics Coalesces",
cfg: func() *WriterConfig {
conf := DefaultWriterConfig()
conf.DataPageStatistics = true
return conf
}(),
},
}
for _, tc := range tcs {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
writer := NewGenericWriter[RowType](os.Stdout, tc.cfg)
if reflect.DeepEqual(tc.cfg, writer.base.config) {
t.Fatalf("expected %+v, got %+v\n", tc.cfg, writer.base.config)
}
})
}
}