<commit_before>var expect = require('expect.js'),
    path = require('path'),
    fs = require('fs'),
    thunkify = require('thunkify'),
    Q = require('q'),
    gochan = require('..');

function fixture(filename) {
  return path.join(__dirname, 'fixtures', filename);
}

describe('gochan', function() {
  it('should be able to use put and get functions', function(done) {
    var ch = gochan();

    var result = [];
    setImmediate(function () {
      result.push('before');
      ch.put(42, function () {
        result.push('after');
        expect(result).to.eql(['before', 'received 42', 'after']);
        done();
      });
    });

    setImmediate(function () {
      ch.get(function (err, value) {
        if (err) return done(err);
        result.push('received ' + value);
      });
    });
  });

  it('should be able to put values without callbacks', function(done) {
    var ch = gochan();
    for (var i = 0; i < 5; i++) {
      ch.put(i);
    }

    var results = [];
    var i = 0;
    (function next() {
      if (i++ < 5) {
        ch.get(function (err, value) {<commit_msg>fix lint<commit_after>var expect = require('expect.js'),
    path = require('path'),
    fs = require('fs'),
    thunkify = require('thunkify'),
    Q = require('q'),
    gochan = require('..');

function fixture(filename) {
  return path.join(__dirname, 'fixtures', filename);
}

describe('gochan', function() {
  it('should be able to use put and get functions', function(done) {
    var ch = gochan();

    var result = [];
    setImmediate(function () {
      result.push('before');
      ch.put(42, function () {
        result.push('after');
        expect(result).to.eql(['before', 'received 42', 'after']);
        done();
      });
    });

    setImmediate(function () {
      ch.get(function (err, value) {
        if (err) return done(err);
        result.push('received ' + value);
      });
    });
  });

  it('should be able to put values without callbacks', function(done) {
    var ch = gochan();
    for (var i = 0; i < 5; i++) {
      ch.put(i);
    }

    var results = [];
    var j = 0;
    (function next() {
      if (j++ < 5) {
        ch.get(function (err, value) {
{'fraction_non_alphanumeric': 0.1845591594335313, 'fraction_numerical': 0.007309273640931932, 'mean_word_length': 2.4872611464968153, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5060563', 'n_tokens_mistral': 723, 'n_tokens_neox': 694, 'n_words': 179}