-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_test.go
63 lines (60 loc) · 1.11 KB
/
main_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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package youn26b
import (
"reflect"
"strconv"
"testing"
"github.com/xild/youn26b/cmd/ynab"
)
func TestExecutor_leftAntiJoin(t *testing.T) {
type args struct {
left []ynab.Transaction
right []ynab.Transaction
}
tests := []struct {
args args
wantResult []ynab.Transaction
}{
{
args: args{
left: []ynab.Transaction{
{
Date: "2019-01-01",
Amount: -1000,
},
{
Date: "2019-01-01",
Amount: -2000,
},
{
Date: "2019-01-01",
Amount: -3000,
},
},
right: []ynab.Transaction{
{
Date: "2019-01-01",
Amount: -2000,
},
{
Date: "2019-01-01",
Amount: -3000,
},
},
},
wantResult: []ynab.Transaction{
{
Date: "2019-01-01",
Amount: -1000,
},
},
},
}
for i, tt := range tests {
t.Run("test"+strconv.Itoa(i), func(t *testing.T) {
e := &Executor{}
if gotResult := e.leftAntiJoin(tt.args.left, tt.args.right); !reflect.DeepEqual(gotResult, tt.wantResult) {
t.Errorf("Executor.leftAntiJoin() = %v, want %v", gotResult, tt.wantResult)
}
})
}
}