| 1 | package dstream |
| 2 | |
| 3 | import "testing" |
| 4 | |
| 5 | func TestDechunk1(t *testing.T) { |
| 6 | |
| 7 | x := [][]interface{}{ |
| 8 | { |
| 9 | []float64{0, 1, 2}, |
| 10 | []float64{3, 4, 5, 6}, |
| 11 | []float64{7}, |
| 12 | }, |
| 13 | { |
| 14 | []string{"a", "b", "c"}, |
| 15 | []string{"d", "e", "f", "g"}, |
| 16 | []string{"h"}, |
| 17 | }, |
| 18 | { |
| 19 | []int32{1, 2, 3}, |
| 20 | []int32{4, 5, 6, 7}, |
| 21 | []int32{8}, |
| 22 | }, |
| 23 | } |
| 24 | na := []string{"x1", "x2", "x3"} |
| 25 | da := NewFromArrays(x, na) |
| 26 | |
| 27 | x = [][]interface{}{ |
| 28 | { |
| 29 | []float64{0, 1, 2, 3, 4, 5, 6, 7}, |
| 30 | }, |
| 31 | { |
| 32 | []string{"a", "b", "c", "d", "e", "f", "g", "h"}, |
| 33 | }, |
| 34 | { |
| 35 | []int32{1, 2, 3, 4, 5, 6, 7, 8}, |
| 36 | }, |
| 37 | } |
| 38 | na = []string{"x1", "x2", "x3"} |
| 39 | db := NewFromArrays(x, na) |
| 40 | |
| 41 | dc := Dechunk(da) |
| 42 | |
| 43 | if !EqualReport(dc, db, true) { |
| 44 | t.Fail() |
| 45 | } |
| 46 | } |