File: concatvertical_test.go

package info (click to toggle)
golang-github-kshedden-dstream 0.0~git20190512.c4c4106-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 596 kB
  • sloc: makefile: 30
file content (39 lines) | stat: -rw-r--r-- 713 bytes parent folder | download
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
package dstream

import "testing"

func TestConcatVertical1(t *testing.T) {

	x1 := []interface{}{
		[]float64{0, 1, 1},
		[]float64{0, 0, 1, 0},
	}
	x2 := []interface{}{
		[]float64{1, 1, 1},
		[]float64{1, 1, 1, 1},
	}
	da := NewFromArrays([][]interface{}{x1, x2}, []string{"x1", "x2"})

	x1 = []interface{}{
		[]float64{0, 1, 1},
		[]float64{0, 0, 1, 0},
		[]float64{0, 1, 1},
		[]float64{0, 0, 1, 0},
	}
	x2 = []interface{}{
		[]float64{1, 1, 1},
		[]float64{1, 1, 1, 1},
		[]float64{1, 1, 1},
		[]float64{1, 1, 1, 1},
	}
	de := NewFromArrays([][]interface{}{x1, x2}, []string{"x1", "x2"})

	db := MemCopy(da, true)
	da.Reset()

	dq := ConcatVertical(da, db)

	if !EqualReport(dq, de, true) {
		t.Fail()
	}
}