@@ -10,7 +10,7 @@ import (
1010 "testing"
1111)
1212
13- // go test -v -cover -count=1 -test.cpu=1 - run=^TestWithFastFailed$
13+ // go test -v -cover -run=^TestWithFastFailed$
1414func TestWithFastFailed (t * testing.T ) {
1515 conf := & config {fastFailed : false }
1616 WithFastFailed ()(conf )
@@ -20,30 +20,42 @@ func TestWithFastFailed(t *testing.T) {
2020 }
2121}
2222
23- // go test -v -cover -count=1 -test.cpu=1 - run=^TestWithPoolFullErr$
23+ // go test -v -cover -run=^TestWithPoolFullErr$
2424func TestWithPoolFullErr (t * testing.T ) {
2525 newPoolFullErr := func (ctx context.Context ) error {
2626 return nil
2727 }
2828
29- conf := & config {newPoolFullErrFunc : nil }
29+ conf := & config {newPoolFullErr : nil }
3030 WithPoolFullErr (newPoolFullErr )(conf )
3131
32- if fmt .Sprintf ("%p" , conf .newPoolFullErrFunc ) != fmt .Sprintf ("%p" , newPoolFullErr ) {
33- t .Fatalf ("conf.newPoolFullErrFunc %p is wrong" , conf .newPoolFullErrFunc )
32+ if fmt .Sprintf ("%p" , conf .newPoolFullErr ) != fmt .Sprintf ("%p" , newPoolFullErr ) {
33+ t .Fatalf ("conf.newPoolFullErr %p is wrong" , conf .newPoolFullErr )
34+ }
35+
36+ WithPoolFullErr (nil )(conf )
37+
38+ if fmt .Sprintf ("%p" , conf .newPoolFullErr ) != fmt .Sprintf ("%p" , newPoolFullErr ) {
39+ t .Fatalf ("conf.newPoolFullErr %p is wrong" , conf .newPoolFullErr )
3440 }
3541}
3642
37- // go test -v -cover -count=1 -test.cpu=1 - run=^TestWithPoolClosedErr$
43+ // go test -v -cover -run=^TestWithPoolClosedErr$
3844func TestWithPoolClosedErr (t * testing.T ) {
3945 newPoolClosedErr := func (ctx context.Context ) error {
4046 return nil
4147 }
4248
43- conf := & config {newPoolClosedErrFunc : nil }
49+ conf := & config {newPoolClosedErr : nil }
4450 WithPoolClosedErr (newPoolClosedErr )(conf )
4551
46- if fmt .Sprintf ("%p" , conf .newPoolClosedErrFunc ) != fmt .Sprintf ("%p" , newPoolClosedErr ) {
47- t .Fatalf ("conf.newPoolClosedErrFunc %p is wrong" , conf .newPoolClosedErrFunc )
52+ if fmt .Sprintf ("%p" , conf .newPoolClosedErr ) != fmt .Sprintf ("%p" , newPoolClosedErr ) {
53+ t .Fatalf ("conf.newPoolClosedErr %p is wrong" , conf .newPoolClosedErr )
54+ }
55+
56+ WithPoolClosedErr (nil )(conf )
57+
58+ if fmt .Sprintf ("%p" , conf .newPoolClosedErr ) != fmt .Sprintf ("%p" , newPoolClosedErr ) {
59+ t .Fatalf ("conf.newPoolClosedErr %p is wrong" , conf .newPoolClosedErr )
4860 }
4961}
0 commit comments