Skip to content

Commit 447a430

Browse files
Merge pull request #124 from logic-building/EqualMap<Type>P
Added function EqualMap<Type>
2 parents c7444a6 + 03e1cd1 commit 447a430

17 files changed

+2541
-379
lines changed

fp/equalmap.go

Lines changed: 701 additions & 0 deletions
Large diffs are not rendered by default.

fp/equalmap_test.go

Lines changed: 1034 additions & 0 deletions
Large diffs are not rendered by default.

fp/everyerr_test.go

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func TestEveryIntPErr(t *testing.T) {
2929

3030
list2 := []int{v8, v2, v10, v5, v4}
3131
r, _ = EveryIntErr(isEvenIntErr, list2)
32-
if r {
32+
if r {
3333
t.Errorf("EveryIntPtrErr failed. Expected=false, actual=true")
3434
}
3535

@@ -43,7 +43,7 @@ func TestEveryIntPErr(t *testing.T) {
4343
t.Errorf("EveryIntErr failed. Expected=false, actual=true")
4444
}
4545

46-
r, _= EveryIntErr(nil, []int{})
46+
r, _ = EveryIntErr(nil, []int{})
4747
if r {
4848
t.Errorf("EveryIntErr failed. Expected=false, actual=true")
4949
}
@@ -73,7 +73,7 @@ func TestEveryInt64Err(t *testing.T) {
7373

7474
list2 := []int64{v8, v2, v10, v5, v4}
7575
r, _ = EveryInt64Err(isEvenInt64Err, list2)
76-
if r {
76+
if r {
7777
t.Errorf("EveryInt64PtrErr failed. Expected=false, actual=true")
7878
}
7979

@@ -87,7 +87,7 @@ func TestEveryInt64Err(t *testing.T) {
8787
t.Errorf("EveryInt64Err failed. Expected=false, actual=true")
8888
}
8989

90-
r, _= EveryInt64Err(nil, []int64{})
90+
r, _ = EveryInt64Err(nil, []int64{})
9191
if r {
9292
t.Errorf("EveryInt64Err failed. Expected=false, actual=true")
9393
}
@@ -117,7 +117,7 @@ func TestEveryInt32Err(t *testing.T) {
117117

118118
list2 := []int32{v8, v2, v10, v5, v4}
119119
r, _ = EveryInt32Err(isEvenInt32Err, list2)
120-
if r {
120+
if r {
121121
t.Errorf("EveryInt32PtrErr failed. Expected=false, actual=true")
122122
}
123123

@@ -131,7 +131,7 @@ func TestEveryInt32Err(t *testing.T) {
131131
t.Errorf("EveryInt32Err failed. Expected=false, actual=true")
132132
}
133133

134-
r, _= EveryInt32Err(nil, []int32{})
134+
r, _ = EveryInt32Err(nil, []int32{})
135135
if r {
136136
t.Errorf("EveryInt32Err failed. Expected=false, actual=true")
137137
}
@@ -161,7 +161,7 @@ func TestEveryInt16Err(t *testing.T) {
161161

162162
list2 := []int16{v8, v2, v10, v5, v4}
163163
r, _ = EveryInt16Err(isEvenInt16Err, list2)
164-
if r {
164+
if r {
165165
t.Errorf("EveryInt16PtrErr failed. Expected=false, actual=true")
166166
}
167167

@@ -175,7 +175,7 @@ func TestEveryInt16Err(t *testing.T) {
175175
t.Errorf("EveryInt16Err failed. Expected=false, actual=true")
176176
}
177177

178-
r, _= EveryInt16Err(nil, []int16{})
178+
r, _ = EveryInt16Err(nil, []int16{})
179179
if r {
180180
t.Errorf("EveryInt16Err failed. Expected=false, actual=true")
181181
}
@@ -205,7 +205,7 @@ func TestEveryInt8Err(t *testing.T) {
205205

206206
list2 := []int8{v8, v2, v10, v5, v4}
207207
r, _ = EveryInt8Err(isEvenInt8Err, list2)
208-
if r {
208+
if r {
209209
t.Errorf("EveryInt8PtrErr failed. Expected=false, actual=true")
210210
}
211211

@@ -219,7 +219,7 @@ func TestEveryInt8Err(t *testing.T) {
219219
t.Errorf("EveryInt8Err failed. Expected=false, actual=true")
220220
}
221221

222-
r, _= EveryInt8Err(nil, []int8{})
222+
r, _ = EveryInt8Err(nil, []int8{})
223223
if r {
224224
t.Errorf("EveryInt8Err failed. Expected=false, actual=true")
225225
}
@@ -249,7 +249,7 @@ func TestEveryUintErr(t *testing.T) {
249249

250250
list2 := []uint{v8, v2, v10, v5, v4}
251251
r, _ = EveryUintErr(isEvenUintErr, list2)
252-
if r {
252+
if r {
253253
t.Errorf("EveryUintPtrErr failed. Expected=false, actual=true")
254254
}
255255

@@ -263,7 +263,7 @@ func TestEveryUintErr(t *testing.T) {
263263
t.Errorf("EveryUintErr failed. Expected=false, actual=true")
264264
}
265265

266-
r, _= EveryUintErr(nil, []uint{})
266+
r, _ = EveryUintErr(nil, []uint{})
267267
if r {
268268
t.Errorf("EveryUintErr failed. Expected=false, actual=true")
269269
}
@@ -293,7 +293,7 @@ func TestEveryUint64Err(t *testing.T) {
293293

294294
list2 := []uint64{v8, v2, v10, v5, v4}
295295
r, _ = EveryUint64Err(isEvenUint64Err, list2)
296-
if r {
296+
if r {
297297
t.Errorf("EveryUint64PtrErr failed. Expected=false, actual=true")
298298
}
299299

@@ -307,7 +307,7 @@ func TestEveryUint64Err(t *testing.T) {
307307
t.Errorf("EveryUint64Err failed. Expected=false, actual=true")
308308
}
309309

310-
r, _= EveryUint64Err(nil, []uint64{})
310+
r, _ = EveryUint64Err(nil, []uint64{})
311311
if r {
312312
t.Errorf("EveryUint64Err failed. Expected=false, actual=true")
313313
}
@@ -337,7 +337,7 @@ func TestEveryUint32Err(t *testing.T) {
337337

338338
list2 := []uint32{v8, v2, v10, v5, v4}
339339
r, _ = EveryUint32Err(isEvenUint32Err, list2)
340-
if r {
340+
if r {
341341
t.Errorf("EveryUint32PtrErr failed. Expected=false, actual=true")
342342
}
343343

@@ -351,7 +351,7 @@ func TestEveryUint32Err(t *testing.T) {
351351
t.Errorf("EveryUint32Err failed. Expected=false, actual=true")
352352
}
353353

354-
r, _= EveryUint32Err(nil, []uint32{})
354+
r, _ = EveryUint32Err(nil, []uint32{})
355355
if r {
356356
t.Errorf("EveryUint32Err failed. Expected=false, actual=true")
357357
}
@@ -381,7 +381,7 @@ func TestEveryUint16Err(t *testing.T) {
381381

382382
list2 := []uint16{v8, v2, v10, v5, v4}
383383
r, _ = EveryUint16Err(isEvenUint16Err, list2)
384-
if r {
384+
if r {
385385
t.Errorf("EveryUint16PtrErr failed. Expected=false, actual=true")
386386
}
387387

@@ -395,7 +395,7 @@ func TestEveryUint16Err(t *testing.T) {
395395
t.Errorf("EveryUint16Err failed. Expected=false, actual=true")
396396
}
397397

398-
r, _= EveryUint16Err(nil, []uint16{})
398+
r, _ = EveryUint16Err(nil, []uint16{})
399399
if r {
400400
t.Errorf("EveryUint16Err failed. Expected=false, actual=true")
401401
}
@@ -425,7 +425,7 @@ func TestEveryUint8Err(t *testing.T) {
425425

426426
list2 := []uint8{v8, v2, v10, v5, v4}
427427
r, _ = EveryUint8Err(isEvenUint8Err, list2)
428-
if r {
428+
if r {
429429
t.Errorf("EveryUint8PtrErr failed. Expected=false, actual=true")
430430
}
431431

@@ -439,7 +439,7 @@ func TestEveryUint8Err(t *testing.T) {
439439
t.Errorf("EveryUint8Err failed. Expected=false, actual=true")
440440
}
441441

442-
r, _= EveryUint8Err(nil, []uint8{})
442+
r, _ = EveryUint8Err(nil, []uint8{})
443443
if r {
444444
t.Errorf("EveryUint8Err failed. Expected=false, actual=true")
445445
}
@@ -469,7 +469,7 @@ func TestEveryStrErr(t *testing.T) {
469469

470470
list2 := []string{v8, v2, v10, v5, v4}
471471
r, _ = EveryStrErr(isEvenStrErr, list2)
472-
if r {
472+
if r {
473473
t.Errorf("EveryStrPtrErr failed. Expected=false, actual=true")
474474
}
475475

@@ -483,7 +483,7 @@ func TestEveryStrErr(t *testing.T) {
483483
t.Errorf("EveryStrErr failed. Expected=false, actual=true")
484484
}
485485

486-
r, _= EveryStrErr(nil, []string{})
486+
r, _ = EveryStrErr(nil, []string{})
487487
if r {
488488
t.Errorf("EveryStrErr failed. Expected=false, actual=true")
489489
}
@@ -517,7 +517,7 @@ func TestEveryBoolErr(t *testing.T) {
517517
if r {
518518
t.Errorf("EveryBoolErr failed. Expected=true, actual=false")
519519
}
520-
520+
521521
list1 = []bool{}
522522
r, _ = EveryBoolErr(TrueErr, list1)
523523
if r {
@@ -575,7 +575,7 @@ func TestEveryFloat32Err(t *testing.T) {
575575

576576
list2 := []float32{v8, v2, v10, v5, v4}
577577
r, _ = EveryFloat32Err(isEvenFloat32Err, list2)
578-
if r {
578+
if r {
579579
t.Errorf("EveryFloat32PtrErr failed. Expected=false, actual=true")
580580
}
581581

@@ -589,7 +589,7 @@ func TestEveryFloat32Err(t *testing.T) {
589589
t.Errorf("EveryFloat32Err failed. Expected=false, actual=true")
590590
}
591591

592-
r, _= EveryFloat32Err(nil, []float32{})
592+
r, _ = EveryFloat32Err(nil, []float32{})
593593
if r {
594594
t.Errorf("EveryFloat32Err failed. Expected=false, actual=true")
595595
}
@@ -619,7 +619,7 @@ func TestEveryFloat64Err(t *testing.T) {
619619

620620
list2 := []float64{v8, v2, v10, v5, v4}
621621
r, _ = EveryFloat64Err(isEvenFloat64Err, list2)
622-
if r {
622+
if r {
623623
t.Errorf("EveryFloat64PtrErr failed. Expected=false, actual=true")
624624
}
625625

@@ -633,7 +633,7 @@ func TestEveryFloat64Err(t *testing.T) {
633633
t.Errorf("EveryFloat64Err failed. Expected=false, actual=true")
634634
}
635635

636-
r, _= EveryFloat64Err(nil, []float64{})
636+
r, _ = EveryFloat64Err(nil, []float64{})
637637
if r {
638638
t.Errorf("EveryFloat64Err failed. Expected=false, actual=true")
639639
}

0 commit comments

Comments
 (0)