<commit_before>
var sf = require('..');

exports['execute sync function in sequence'] = function (test) {
    test.async();
    
    var seq = sf.sequence(function (data) {
        test.equal(data, 42);
        test.done();
    });
    
    seq.run(42);
};

exports['execute sync function in sequence with success'] = function (test) {
    test.async();
    
    var seq = sf.sequence(function (data) {
        test.equal(data, 42);
        return data + 1;
    });
    
    seq.run(42).success(function (data) {
        test.equal(data, 43);
        test.done();
    });
};

exports['execute two sync functions in sequence'] = function (test) {
    test.async();
    
    var seq = sf.sequence(
        function (data) {
            test.equal(data, 42);
            return data + 1;
        },
        function (data) {
            test.equal(data, 43);
            test.done();
        }
    );
    
    seq.run(42);
};

exports['execute three sync functions in sequence'] = function (test) {
    test.async();
    
    var seq = sf.sequence(
        function (data) {
            test.equal(data, 42);
            return data + 1;
        },
        function (data) {
            test.equal(data, 43);
            return data + 1;
        },
        function (data) {
            test.equal(data, 44);
            test.done();
        }
    );
    
    seq.run(42);
};

exports['execute async function in sequence'] = function (test) {
    test.async();
    
    var seq = sf.sequence(function (data, next) {
        test.equal(data, 42);
        test.ok(next);
        test.done();
        next(null, null);
    });
    
    seq.run(42);
};

exports['execute two async function in sequence'] = function (test) {
    test.async();
    
    var seq = sf.sequence(
        function (data, next) {
            test.ok(next);
            next(null, data + 1);
        },        
        function (data, next) {
            test.ok(next);
            test.done();
            next(null, null);
        }
    );
    
    seq.run(42);
};

exports['execute three async function in sequence'] = function (test) {
    test.async();
    
    var seq = sf.sequence(
        function (data, next) {
            test.equal(data, 42);
            test.ok(next);
            next(null, data + 1);
        },        
        function (data, next) {
            test.equal(data, 43);
            test.ok(next);
            next(null, data + 1);
        },        
        function (data, next) {
            test.equal(data, 44);
            test.ok(next);
            test.done();
            next(null, null);
        }
    );
    
    seq.run(42);
};<commit_msg>Additional test with success for future result<commit_after>
var sf = require('..');

exports['execute sync function in sequence'] = function (test) {
    test.async();
    
    var seq = sf.sequence(function (data) {
        test.equal(data, 42);
        test.done();
    });
    
    seq.run(42);
};

exports['execute sync function in sequence with success'] = function (test) {
    test.async();
    
    var seq = sf.sequence(function (data) {
        test.equal(data, 42);
        return data + 1;
    });
    
    seq.run(42).success(function (data) {
        test.equal(data, 43);
        test.done();
    });
};

exports['execute two sync functions in sequence'] = function (test) {
    test.async();
    
    var seq = sf.sequence(
        function (data) {
            test.equal(data, 42);
            return data + 1;
        },
        function (data) {
            test.equal(data, 43);
            test.done();
        }
    );
    
    seq.run(42);
};

exports['execute two sync function in sequence with success'] = function (test) {
    test.async();
    
    var seq = sf.sequence(
        function (data) {
            test.equal(data, 42);
            return data + 1;
        },
        function (data) {
            test.equal(data, 43);
            return data + 1;
        }
    );
    
    seq.run(42).success(function (data) {
        test.equal(data, 44);
        test.done();
    });
};

exports['execute three sync functions in sequence'] = function (test) {
    test.async();
    
    var seq = sf.sequence(
        function (data) {
            test.equal(data, 42);
            return data + 1;
        },
        function (data) {
            test.equal(data, 43);
            return data + 1;
        },
        function (data) {
            test.equal(data, 44);
            test.done();
        }
    );
    
    seq.run(42);
};

exports['execute async function in sequence'] = function (test) {
    test.async();
    
    var seq = sf.sequence(function (data, next) {
        test.equal(data, 42);
        test.ok(next);
        test.done();
        next(null, null);
    });
    
    seq.run(42);
};

exports['execute async function in sequence with success'] = function (test) {
    test.async();
    
    var seq = sf.sequence(function (data, next) {
        test.equal(data, 42);
        next(null, data + 1);
    });
    
    seq.run(42).success(function (data) {
        test.equal(data, 43);
        test.done();
    });
};

exports['execute two async function in sequence'] = function (test) {
    test.async();
    
    var seq = sf.sequence(
        function (data, next) {
            test.ok(next);
            next(null, data + 1);
        },        
        function (data, next) {
            test.ok(next);
            test.done();
            next(null, null);
        }
    );
    
    seq.run(42);
};

exports['execute two async function in sequence with success'] = function (test) {
    test.async();
    
    var seq = sf.sequence(
        function (data, next) {
            test.equal(data, 42);
            test.ok(next);
            next(null, data + 1);
        },        
        function (data, next) {
            test.equal(data, 43);
            test.ok(next);
            next(null, data + 1);
        }
    );
    
    seq.run(42).success(function (data) {
        test.equal(data, 44);
        test.done();
    });
};

exports['execute three async function in sequence'] = function (test) {
    test.async();
    
    var seq = sf.sequence(
        function (data, next) {
            test.equal(data, 42);
            test.ok(next);
            next(null, data + 1);
        },        
        function (data, next) {
            test.equal(data, 43);
            test.ok(next);
            next(null, data + 1);
        },        
        function (data, next) {
            test.equal(data, 44);
            test.ok(next);
            test.done();
            next(null, null);
        }
    );
    
    seq.run(42);
};
{'fraction_non_alphanumeric': 0.1465543183869997, 'fraction_numerical': 0.01760457417995787, 'mean_word_length': 1.5244967717432587, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4179322', 'n_tokens_mistral': 2080, 'n_tokens_neox': 1978, 'n_words': 477}