Debian Codegraph @

dstream/sizechunk_test.go

raw symbols SCIP
1 package dstream
2
3 import "testing"
4
5 func TestMaxChunkSize(t *testing.T) {
6
7 x1 := []interface{}{
8 []float64{0, 0, 0, 0, 0, 1, 1, 2, 3},
9 }
10 x2 := []interface{}{
11 []float64{1, 1, 1, 1, 2, 2, 4, 5, 6},
12 }
13 x3 := []interface{}{
14 []float64{2, 2, 3, 3, 3, 3, 7, 8, 9},
15 }
16 x4 := []interface{}{
17 []string{"a", "b", "c", "d", "e", "f", "g", "h", "i"},
18 }
19 dat := [][]interface{}{x1, x2, x3, x4}
20 na := []string{"x1", "x2", "x3", "x4"}
21 da := NewFromArrays(dat, na)
22
23 x1 = []interface{}{
24 []float64{0, 0, 0, 0},
25 []float64{0, 1, 1, 2},
26 []float64{3},
27 }
28 x2 = []interface{}{
29 []float64{1, 1, 1, 1},
30 []float64{2, 2, 4, 5},
31 []float64{6},
32 }
33 x3 = []interface{}{
34 []float64{2, 2, 3, 3},
35 []float64{3, 3, 7, 8},
36 []float64{9},
37 }
38 x4 = []interface{}{
39 []string{"a", "b", "c", "d"},
40 []string{"e", "f", "g", "h"},
41 []string{"i"},
42 }
43 dat = [][]interface{}{x1, x2, x3, x4}
44 na = []string{"x1", "x2", "x3", "x4"}
45 de := NewFromArrays(dat, na)
46
47 dx := MaxChunkSize(da, 4)
48
49 if !EqualReport(dx, de, true) {
50 t.Fail()
51 }
52 }