mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 02:44:59 +00:00
Test Row Append (#2323)
This commit is contained in:
parent
e02ea2c2e7
commit
f514474014
1 changed files with 41 additions and 0 deletions
41
sql3/planner/types/operator_test.go
Normal file
41
sql3/planner/types/operator_test.go
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
package types
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestRow_Append(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
src Row
|
||||
arg Row
|
||||
want Row
|
||||
}{
|
||||
{
|
||||
name: "basic",
|
||||
src: Row{1, 2, 3},
|
||||
arg: Row{4, 5, 6, 7},
|
||||
want: Row{1, 2, 3, 4, 5, 6, 7},
|
||||
},
|
||||
{
|
||||
name: "left",
|
||||
src: Row{},
|
||||
arg: Row{4, 5, 6},
|
||||
want: Row{4, 5, 6},
|
||||
},
|
||||
{
|
||||
name: "right",
|
||||
src: Row{1, 2, 3},
|
||||
arg: Row{},
|
||||
want: Row{1, 2, 3},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got := tt.src.Append(tt.arg)
|
||||
assert.Equal(t, tt.want, got)
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue