Skip to content

Commit 24d953a

Browse files
authored
chore: run go fmt (#20)
1 parent 6501404 commit 24d953a

File tree

2 files changed

+64
-64
lines changed

2 files changed

+64
-64
lines changed

compose_test.go

+63-63
Original file line numberDiff line numberDiff line change
@@ -3,114 +3,114 @@ package fp
33
import "testing"
44

55
func add1(x int) int {
6-
return x + 1
6+
return x + 1
77
}
88

99
func double(x int) int {
10-
return x * 2
10+
return x * 2
1111
}
1212

1313
func TestCompose2_Example(t *testing.T) {
14-
res := Compose2(add1, double)(0)
15-
if res != 1 {
16-
t.Error("Should perform right-to-left function composition of 2 functions. Received:", res)
17-
}
14+
res := Compose2(add1, double)(0)
15+
if res != 1 {
16+
t.Error("Should perform right-to-left function composition of 2 functions. Received:", res)
17+
}
1818
}
1919

2020
func TestCompose3_Example(t *testing.T) {
21-
res := Compose3(add1, double, add1)(0)
22-
if res != 3 {
23-
t.Error("Should perform right-to-left function composition of 3 functions. Received:", res)
24-
}
21+
res := Compose3(add1, double, add1)(0)
22+
if res != 3 {
23+
t.Error("Should perform right-to-left function composition of 3 functions. Received:", res)
24+
}
2525
}
2626

2727
func TestCompose4_Example(t *testing.T) {
28-
res := Compose4(add1, double, add1, double)(0)
29-
if res != 3 {
30-
t.Error("Should perform right-to-left function composition of 4 functions. Received:", res)
31-
}
28+
res := Compose4(add1, double, add1, double)(0)
29+
if res != 3 {
30+
t.Error("Should perform right-to-left function composition of 4 functions. Received:", res)
31+
}
3232
}
3333

3434
func TestCompose5_Example(t *testing.T) {
35-
res := Compose5(add1, double, add1, double, add1)(0)
36-
if res != 7 {
37-
t.Error("Should perform right-to-left function composition of 5 functions. Received:", res)
38-
}
35+
res := Compose5(add1, double, add1, double, add1)(0)
36+
if res != 7 {
37+
t.Error("Should perform right-to-left function composition of 5 functions. Received:", res)
38+
}
3939
}
4040

4141
func TestCompose6_Example(t *testing.T) {
42-
res := Compose6(add1, double, add1, double, add1, double)(0)
43-
if res != 7 {
44-
t.Error("Should perform right-to-left function composition of 6 functions. Received:", res)
45-
}
42+
res := Compose6(add1, double, add1, double, add1, double)(0)
43+
if res != 7 {
44+
t.Error("Should perform right-to-left function composition of 6 functions. Received:", res)
45+
}
4646
}
4747

4848
func TestCompose7_Example(t *testing.T) {
49-
res := Compose7(add1, double, add1, double, add1, double, add1)(0)
50-
if res != 15 {
51-
t.Error("Should perform right-to-left function composition of 7 functions. Received:", res)
52-
}
49+
res := Compose7(add1, double, add1, double, add1, double, add1)(0)
50+
if res != 15 {
51+
t.Error("Should perform right-to-left function composition of 7 functions. Received:", res)
52+
}
5353
}
5454

5555
func TestCompose8_Example(t *testing.T) {
56-
res := Compose8(add1, double, add1, double, add1, double, add1, double)(0)
57-
if res != 15 {
58-
t.Error("Should perform right-to-left function composition of 8 functions. Received:", res)
59-
}
56+
res := Compose8(add1, double, add1, double, add1, double, add1, double)(0)
57+
if res != 15 {
58+
t.Error("Should perform right-to-left function composition of 8 functions. Received:", res)
59+
}
6060
}
6161

6262
func TestCompose9_Example(t *testing.T) {
63-
res := Compose9(add1, double, add1, double, add1, double, add1, double, add1)(0)
64-
if res != 31 {
65-
t.Error("Should perform right-to-left function composition of 9 functions. Received:", res)
66-
}
63+
res := Compose9(add1, double, add1, double, add1, double, add1, double, add1)(0)
64+
if res != 31 {
65+
t.Error("Should perform right-to-left function composition of 9 functions. Received:", res)
66+
}
6767
}
6868

6969
func TestCompose10_Example(t *testing.T) {
70-
res := Compose10(add1, double, add1, double, add1, double, add1, double, add1, double)(0)
71-
if res != 31 {
72-
t.Error("Should perform right-to-left function composition of 10 functions. Received:", res)
73-
}
70+
res := Compose10(add1, double, add1, double, add1, double, add1, double, add1, double)(0)
71+
if res != 31 {
72+
t.Error("Should perform right-to-left function composition of 10 functions. Received:", res)
73+
}
7474
}
7575

7676
func TestCompose11_Example(t *testing.T) {
77-
res := Compose11(add1, double, add1, double, add1, double, add1, double, add1, double, add1)(0)
78-
if res != 63 {
79-
t.Error("Should perform right-to-left function composition of 11 functions. Received:", res)
80-
}
77+
res := Compose11(add1, double, add1, double, add1, double, add1, double, add1, double, add1)(0)
78+
if res != 63 {
79+
t.Error("Should perform right-to-left function composition of 11 functions. Received:", res)
80+
}
8181
}
8282

8383
func TestCompose12_Example(t *testing.T) {
84-
res := Compose12(add1, double, add1, double, add1, double, add1, double, add1, double, add1, double)(0)
85-
if res != 63 {
86-
t.Error("Should perform right-to-left function composition of 12 functions. Received:", res)
87-
}
84+
res := Compose12(add1, double, add1, double, add1, double, add1, double, add1, double, add1, double)(0)
85+
if res != 63 {
86+
t.Error("Should perform right-to-left function composition of 12 functions. Received:", res)
87+
}
8888
}
8989

9090
func TestCompose13_Example(t *testing.T) {
91-
res := Compose13(add1, double, add1, double, add1, double, add1, double, add1, double, add1, double, add1)(0)
92-
if res != 127 {
93-
t.Error("Should perform right-to-left function composition of 13 functions. Received:", res)
94-
}
91+
res := Compose13(add1, double, add1, double, add1, double, add1, double, add1, double, add1, double, add1)(0)
92+
if res != 127 {
93+
t.Error("Should perform right-to-left function composition of 13 functions. Received:", res)
94+
}
9595
}
9696

9797
func TestCompose14_Example(t *testing.T) {
98-
res := Compose14(add1, double, add1, double, add1, double, add1, double, add1, double, add1, double, add1, double)(0)
99-
if res != 127 {
100-
t.Error("Should perform right-to-left function composition of 14 functions. Received:", res)
101-
}
98+
res := Compose14(add1, double, add1, double, add1, double, add1, double, add1, double, add1, double, add1, double)(0)
99+
if res != 127 {
100+
t.Error("Should perform right-to-left function composition of 14 functions. Received:", res)
101+
}
102102
}
103103

104104
func TestCompose15_Example(t *testing.T) {
105-
res := Compose15(add1, double, add1, double, add1, double, add1, double, add1, double, add1, double, add1, double, add1)(0)
106-
if res != 255 {
107-
t.Error("Should perform right-to-left function composition of 15 functions. Received:", res)
108-
}
105+
res := Compose15(add1, double, add1, double, add1, double, add1, double, add1, double, add1, double, add1, double, add1)(0)
106+
if res != 255 {
107+
t.Error("Should perform right-to-left function composition of 15 functions. Received:", res)
108+
}
109109
}
110110

111111
func TestCompose16_Example(t *testing.T) {
112-
res := Compose16(add1, double, add1, double, add1, double, add1, double, add1, double, add1, double, add1, double, add1, double)(0)
113-
if res != 255 {
114-
t.Error("Should perform right-to-left function composition of 16 functions. Received:", res)
115-
}
116-
}
112+
res := Compose16(add1, double, add1, double, add1, double, add1, double, add1, double, add1, double, add1, double, add1, double)(0)
113+
if res != 255 {
114+
t.Error("Should perform right-to-left function composition of 16 functions. Received:", res)
115+
}
116+
}

pipe_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,4 @@ func TestPipe16_Example(t *testing.T) {
105105
if res != 510 {
106106
t.Error("Should perform left-to-right function composition of 16 functions. Received:", res)
107107
}
108-
}
108+
}

0 commit comments

Comments
 (0)