| 1 | package dstream |
| 2 | |
| 3 | import "testing" |
| 4 | |
| 5 | func TestConcatVertical1(t *testing.T) { |
| 6 | |
| 7 | x1 := []interface{}{ |
| 8 | []float64{0, 1, 1}, |
| 9 | []float64{0, 0, 1, 0}, |
| 10 | } |
| 11 | x2 := []interface{}{ |
| 12 | []float64{1, 1, 1}, |
| 13 | []float64{1, 1, 1, 1}, |
| 14 | } |
| 15 | da := NewFromArrays([][]interface{}{x1, x2}, []string{"x1", "x2"}) |
| 16 | |
| 17 | x1 = []interface{}{ |
| 18 | []float64{0, 1, 1}, |
| 19 | []float64{0, 0, 1, 0}, |
| 20 | []float64{0, 1, 1}, |
| 21 | []float64{0, 0, 1, 0}, |
| 22 | } |
| 23 | x2 = []interface{}{ |
| 24 | []float64{1, 1, 1}, |
| 25 | []float64{1, 1, 1, 1}, |
| 26 | []float64{1, 1, 1}, |
| 27 | []float64{1, 1, 1, 1}, |
| 28 | } |
| 29 | de := NewFromArrays([][]interface{}{x1, x2}, []string{"x1", "x2"}) |
| 30 | |
| 31 | db := MemCopy(da, true) |
| 32 | da.Reset() |
| 33 | |
| 34 | dq := ConcatVertical(da, db) |
| 35 | |
| 36 | if !EqualReport(dq, de, true) { |
| 37 | t.Fail() |
| 38 | } |
| 39 | } |