@@ -2812,7 +2812,7 @@ exports['concatSeries'] = function(test){
2812
2812
} ;
2813
2813
2814
2814
exports [ 'until' ] = function ( test ) {
2815
- test . expect ( 3 ) ;
2815
+ test . expect ( 4 ) ;
2816
2816
2817
2817
var call_order = [ ] ;
2818
2818
var count = 0 ;
@@ -2824,10 +2824,11 @@ exports['until'] = function (test) {
2824
2824
function ( cb ) {
2825
2825
call_order . push ( [ 'iterator' , count ] ) ;
2826
2826
count ++ ;
2827
- cb ( ) ;
2827
+ cb ( null , count ) ;
2828
2828
} ,
2829
- function ( err ) {
2829
+ function ( err , result ) {
2830
2830
test . ok ( err === null , err + " passed instead of 'null'" ) ;
2831
+ test . equals ( result , 5 , 'last result passed through' ) ;
2831
2832
test . same ( call_order , [
2832
2833
[ 'test' , 0 ] ,
2833
2834
[ 'iterator' , 0 ] , [ 'test' , 1 ] ,
@@ -2843,22 +2844,23 @@ exports['until'] = function (test) {
2843
2844
} ;
2844
2845
2845
2846
exports [ 'doUntil' ] = function ( test ) {
2846
- test . expect ( 3 ) ;
2847
+ test . expect ( 4 ) ;
2847
2848
2848
2849
var call_order = [ ] ;
2849
2850
var count = 0 ;
2850
2851
async . doUntil (
2851
2852
function ( cb ) {
2852
2853
call_order . push ( [ 'iterator' , count ] ) ;
2853
2854
count ++ ;
2854
- cb ( ) ;
2855
+ cb ( null , count ) ;
2855
2856
} ,
2856
2857
function ( ) {
2857
2858
call_order . push ( [ 'test' , count ] ) ;
2858
2859
return ( count == 5 ) ;
2859
2860
} ,
2860
- function ( err ) {
2861
+ function ( err , result ) {
2861
2862
test . ok ( err === null , err + " passed instead of 'null'" ) ;
2863
+ test . equals ( result , 5 , 'last result passed through' ) ;
2862
2864
test . same ( call_order , [
2863
2865
[ 'iterator' , 0 ] , [ 'test' , 1 ] ,
2864
2866
[ 'iterator' , 1 ] , [ 'test' , 2 ] ,
@@ -2873,7 +2875,7 @@ exports['doUntil'] = function (test) {
2873
2875
} ;
2874
2876
2875
2877
exports [ 'doUntil callback params' ] = function ( test ) {
2876
- test . expect ( 2 ) ;
2878
+ test . expect ( 3 ) ;
2877
2879
2878
2880
var call_order = [ ] ;
2879
2881
var count = 0 ;
@@ -2887,8 +2889,9 @@ exports['doUntil callback params'] = function (test) {
2887
2889
call_order . push ( [ 'test' , c ] ) ;
2888
2890
return ( c == 5 ) ;
2889
2891
} ,
2890
- function ( err ) {
2892
+ function ( err , result ) {
2891
2893
if ( err ) throw err ;
2894
+ test . equals ( result , 5 , 'last result passed through' ) ;
2892
2895
test . same ( call_order , [
2893
2896
[ 'iterator' , 0 ] , [ 'test' , 1 ] ,
2894
2897
[ 'iterator' , 1 ] , [ 'test' , 2 ] ,
@@ -2903,7 +2906,7 @@ exports['doUntil callback params'] = function (test) {
2903
2906
} ;
2904
2907
2905
2908
exports [ 'whilst' ] = function ( test ) {
2906
- test . expect ( 3 ) ;
2909
+ test . expect ( 4 ) ;
2907
2910
2908
2911
var call_order = [ ] ;
2909
2912
@@ -2916,10 +2919,11 @@ exports['whilst'] = function (test) {
2916
2919
function ( cb ) {
2917
2920
call_order . push ( [ 'iterator' , count ] ) ;
2918
2921
count ++ ;
2919
- cb ( ) ;
2922
+ cb ( null , count ) ;
2920
2923
} ,
2921
- function ( err ) {
2924
+ function ( err , result ) {
2922
2925
test . ok ( err === null , err + " passed instead of 'null'" ) ;
2926
+ test . equals ( result , 5 , 'last result passed through' ) ;
2923
2927
test . same ( call_order , [
2924
2928
[ 'test' , 0 ] ,
2925
2929
[ 'iterator' , 0 ] , [ 'test' , 1 ] ,
@@ -2935,22 +2939,23 @@ exports['whilst'] = function (test) {
2935
2939
} ;
2936
2940
2937
2941
exports [ 'doWhilst' ] = function ( test ) {
2938
- test . expect ( 3 ) ;
2942
+ test . expect ( 4 ) ;
2939
2943
var call_order = [ ] ;
2940
2944
2941
2945
var count = 0 ;
2942
2946
async . doWhilst (
2943
2947
function ( cb ) {
2944
2948
call_order . push ( [ 'iterator' , count ] ) ;
2945
2949
count ++ ;
2946
- cb ( ) ;
2950
+ cb ( null , count ) ;
2947
2951
} ,
2948
2952
function ( ) {
2949
2953
call_order . push ( [ 'test' , count ] ) ;
2950
2954
return ( count < 5 ) ;
2951
2955
} ,
2952
- function ( err ) {
2956
+ function ( err , result ) {
2953
2957
test . ok ( err === null , err + " passed instead of 'null'" ) ;
2958
+ test . equals ( result , 5 , 'last result passed through' ) ;
2954
2959
test . same ( call_order , [
2955
2960
[ 'iterator' , 0 ] , [ 'test' , 1 ] ,
2956
2961
[ 'iterator' , 1 ] , [ 'test' , 2 ] ,
@@ -2965,7 +2970,7 @@ exports['doWhilst'] = function (test) {
2965
2970
} ;
2966
2971
2967
2972
exports [ 'doWhilst callback params' ] = function ( test ) {
2968
- test . expect ( 2 ) ;
2973
+ test . expect ( 3 ) ;
2969
2974
var call_order = [ ] ;
2970
2975
var count = 0 ;
2971
2976
async . doWhilst (
@@ -2978,8 +2983,9 @@ exports['doWhilst callback params'] = function (test) {
2978
2983
call_order . push ( [ 'test' , c ] ) ;
2979
2984
return ( c < 5 ) ;
2980
2985
} ,
2981
- function ( err ) {
2986
+ function ( err , result ) {
2982
2987
if ( err ) throw err ;
2988
+ test . equals ( result , 5 , 'last result passed through' ) ;
2983
2989
test . same ( call_order , [
2984
2990
[ 'iterator' , 0 ] , [ 'test' , 1 ] ,
2985
2991
[ 'iterator' , 1 ] , [ 'test' , 2 ] ,
0 commit comments