-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdays_test.go
53 lines (48 loc) · 987 Bytes
/
days_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
package test
import (
"fmt"
"os/exec"
"strings"
"testing"
"github.com/stretchr/testify/assert"
)
var expectations = map[string]string{
"1-1": "800139",
"1-2": "59885340",
"2-1": "582",
"2-2": "729",
"3-1": "299",
"3-2": "3621285278",
"4-1": "226",
"4-2": "160",
"5-1": "976",
"5-2": "685",
"6-1": "6714",
"6-2": "3435",
"7-1": "278",
"7-2": "45157",
"8-1": "1331",
"8-2": "1121",
"9-1": "29221323",
"9-2": "4389369",
"10-1": "1625",
"10-2": "3100448333024",
"11-1": "2166",
"11-2": "1955",
"12-1": "582",
"12-2": "52069",
"13-1": "174",
"13-2": "780601154795940",
"14-1": "13476250121721",
"14-2": "4463708436768",
"15-1": "1025",
"15-2": "129262",
}
func TestDays(t *testing.T) {
for day, expect := range expectations {
cmd := exec.Command(fmt.Sprintf("bin/%s", day))
out, err := cmd.CombinedOutput()
assert.NoError(t, err)
assert.Equal(t, expect, strings.TrimRight(string(out), "\n"), fmt.Sprintf("Day %s", day))
}
}