@@ -14,7 +14,7 @@ func TestUntil(t *testing.T) {
1414 count := 0
1515
1616 out , err := Until (func (c int ) bool {
17- return c == 5
17+ return c < 5
1818 }, func () int {
1919 count ++
2020 return count
@@ -39,22 +39,22 @@ func TestUntilInvalidParameters(t *testing.T) {
3939 Until (func () {}, func () {})
4040 }, ErrInvalidTestFunc )
4141 a .NotPanicNow (func () {
42- Until (func () bool { return true }, func () {})
42+ Until (func () bool { return false }, func () {})
4343 })
4444 a .NotPanicNow (func () {
45- Until (func (err error ) bool { return true }, func () error { return nil })
45+ Until (func (err error ) bool { return false }, func () error { return nil })
4646 })
4747 a .NotPanicNow (func () {
48- Until (func (ctx context.Context , err error ) bool { return true }, func () error { return nil })
48+ Until (func (ctx context.Context , err error ) bool { return false }, func () error { return nil })
4949 })
5050 a .NotPanicNow (func () {
51- Until (func (ctx context.Context ) bool { return true }, func () error { return nil })
51+ Until (func (ctx context.Context ) bool { return false }, func () error { return nil })
5252 })
5353 a .PanicOfNow (func () {
54- Until (func (ctx context.Context , i int ) bool { return true }, func () error { return nil })
54+ Until (func (ctx context.Context , i int ) bool { return false }, func () error { return nil })
5555 }, ErrInvalidTestFunc )
5656 a .PanicOfNow (func () {
57- Until (func (ctx context.Context , i int ) bool { return true }, func () {})
57+ Until (func (ctx context.Context , i int ) bool { return false }, func () {})
5858 }, ErrInvalidTestFunc )
5959}
6060
@@ -64,7 +64,7 @@ func TestUntilWithFunctionError(t *testing.T) {
6464 unexpectedErr := errors .New ("unexpected error" )
6565
6666 out , err := Until (func (c int , err error ) bool {
67- return c == 5
67+ return c < 5
6868 }, func () (int , error ) {
6969 count ++
7070 return count , unexpectedErr
@@ -96,9 +96,9 @@ func TestUntilWithContext(t *testing.T) {
9696 out , err := UntilWithContext (ctx , func (ctx context.Context ) bool {
9797 select {
9898 case <- ctx .Done ():
99- return true
100- default :
10199 return false
100+ default :
101+ return true
102102 }
103103 }, func () {
104104 })
0 commit comments