<commit_before>var assert = require("assert")
var setTimeout = require("timers").setTimeout
var now = Date.now()

var Queue = require("../index")
var count = 0

var enqueue = Queue(function (item, callback) {
    console.log("# doing", item)
    process.nextTick(function () {
        console.log("# finished", item, Date.now() - now)
        callback()
    })
})

enqueue("one", log("# flushed one"))
enqueue("two", log("# flushed two"))
enqueue("three", log("# flushed three"))

function log(msg) {
    return function () {
        count++
        console.log(msg)
    }
}

setTimeout(function () {
    console.log("# count", count, Date.now() - now)
    assert.equal(count, 3)
}, 400)<commit_msg>no comment before tap version<commit_after>var assert = require("assert")
var setTimeout = require("timers").setTimeout
var now = Date.now()

var Queue = require("../index")
var count = 0

var enqueue = Queue(function (item, callback) {
    // console.log("# doing", item)
    process.nextTick(function () {
        // console.log("# finished", item, Date.now() - now)
        callback()
    })
})

enqueue("one", log("# flushed one"))
enqueue("two", log("# flushed two"))
enqueue("three", log("# flushed three"))

function log(msg) {
    return function () {
        count++
        // console.log(msg)
    }
}

setTimeout(function () {
    console.log("# count", count, Date.now() - now)
    assert.equal(count, 3)
}, 400)
{'fraction_non_alphanumeric': 0.18552354181307099, 'fraction_numerical': 0.007027406886858749, 'mean_word_length': 3.341463414634146, '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': '1952819', 'n_tokens_mistral': 456, 'n_tokens_neox': 440, 'n_words': 117}