-
Notifications
You must be signed in to change notification settings - Fork 0
/
iterator_test.go
44 lines (38 loc) · 1.08 KB
/
iterator_test.go
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
// Code generated by generate.sh; DO NOT EDIT.
package iproto_test
import (
"testing"
"github.com/tarantool/go-iproto"
)
func TestIterator(t *testing.T) {
cases := []struct {
Iterator iproto.Iterator
Str string
Val int
}{
{iproto.ITER_EQ, "ITER_EQ", 0},
{iproto.ITER_REQ, "ITER_REQ", 1},
{iproto.ITER_ALL, "ITER_ALL", 2},
{iproto.ITER_LT, "ITER_LT", 3},
{iproto.ITER_LE, "ITER_LE", 4},
{iproto.ITER_GE, "ITER_GE", 5},
{iproto.ITER_GT, "ITER_GT", 6},
{iproto.ITER_BITS_ALL_SET, "ITER_BITS_ALL_SET", 7},
{iproto.ITER_BITS_ANY_SET, "ITER_BITS_ANY_SET", 8},
{iproto.ITER_BITS_ALL_NOT_SET, "ITER_BITS_ALL_NOT_SET", 9},
{iproto.ITER_OVERLAPS, "ITER_OVERLAPS", 10},
{iproto.ITER_NEIGHBOR, "ITER_NEIGHBOR", 11},
{iproto.ITER_NP, "ITER_NP", 12},
{iproto.ITER_PP, "ITER_PP", 13},
}
for _, tc := range cases {
t.Run(tc.Str, func(t *testing.T) {
if tc.Iterator.String() != tc.Str {
t.Errorf("Got %s, expected %s", tc.Iterator.String(), tc.Str)
}
if int(tc.Iterator) != tc.Val {
t.Errorf("Got %d, expected %d", tc.Iterator, tc.Val)
}
})
}
}