<commit_before>var sequence = require('sequencer').sequence;

var testCase = require('nodeunit').testCase;

module.exports = testCase({

    sequencer_test_001: function (test) {
      var counter = 0;

      var asyncCall = function(callback) {
        // console.log("Finished asyncCall");
        counter++;
        callback();
      }

      var seq = [
        asyncCall,
        asyncCall,
        asyncCall,
        asyncCall,
        asyncCall,
        function(cb) {
          // console.log("Finished sequence");
          test.equals(counter, 5);
          test.done();
        }
      ];

      sequence(seq);
    }

});
<commit_msg>Added two test cases for nested sequencers<commit_after>var sequence = require('sequencer').sequence;

var testCase = require('nodeunit').testCase;

module.exports = testCase({

    sequencer_test_001_basic: function (test) {
      var counter = 0;

      var asyncCall = function(callback) {
        counter++;
        setTimeout(callback, 1);
      }

      sequence([
        asyncCall,
        asyncCall,
        asyncCall,
        asyncCall,
        asyncCall,
        function(cb) {
          test.equals(counter, 5);
          test.done();
        }
        ]
      );
    },

    sequencer_test_002_nested: function (test) {
      var counter = 0;

      var asyncCall = function(callback) {
        counter++;
        callback();
      }

      sequence([
        asyncCall,
        asyncCall,
        asyncCall,
        function(cb) {
          sequence([
            asyncCall,
            asyncCall,
            function(cb) {
              test.equals(counter, 5);
              test.done();
              cb && cb();
            },
            cb
            ]);
        }
        ]
      );
    },

    sequencer_test_003_nested: function (test) {
      var counter = 0;

      var asyncCall = function(callback) {
        counter++;
        callback();
      }

      sequence([
        asyncCall,
        asyncCall,
        function(cb) {
          sequence([
            asyncCall,
            function(cb) {
              sequence([
                asyncCall,
                asyncCall,
                function(cb) {
                  cb && cb();
                },
                cb
                ]);
            },
            function(cb) {
              test.equals(counter, 5);
              test.done();
              cb && cb();
            },
            cb
            ]);
        }
        ]
      );
    }

});

{'fraction_non_alphanumeric': 0.11365461847389559, 'fraction_numerical': 0.008433734939759036, 'mean_word_length': 1.244144144144144, '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': '183267', 'n_tokens_mistral': 689, 'n_tokens_neox': 653, 'n_words': 129}