-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuilder_test.go
More file actions
60 lines (55 loc) · 823 Bytes
/
builder_test.go
File metadata and controls
60 lines (55 loc) · 823 Bytes
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package stream_test
import (
"testing"
"github.com/go-park/stream"
"github.com/stretchr/testify/assert"
)
type P struct {
Name string
Age int
}
func TestBuilder(t *testing.T) {
tests := []struct {
name string
list []P
kvs map[string]P
wantList []P
}{
{
name: "builder",
list: []P{
{
Name: "foo",
Age: 1,
},
{
Name: "bar",
Age: 2,
},
},
wantList: []P{
{
Name: "foo",
Age: 1,
},
{
Name: "bar",
Age: 2,
},
},
},
}
for _, v := range tests {
t.Run(v.name, func(t *testing.T) {
})
}
}
func TestRange(t *testing.T) {
t.Run("0-99", func(t *testing.T) {
var slice []int
for i := 0; i < 100; i++ {
slice = append(slice, i)
}
assert.Equal(t, stream.Range(0, 99).ToSlice(), slice)
})
}