<commit_before>
/*!
 * socket.io-node
 * Copyright(c) 2011 LearnBoost <<EMAIL>>
 * MIT Licensed
 */

(function (module, io, should) {

  module.exports = {

    'add listeners': function () {
      var event = new io.EventEmitter
        , calls = 0;

      event.on('test', function (a, b) {
        ++calls;
        a.should().eql('a');
        b.should().eql('b');
      });

      event.emit('test', 'a', 'b');
      calls.should().eql(1);
      event.on.should().eql(event.addListener);
    },

    'remove listener': function () {
      var event = new io.EventEmitter;
      function empty () { }

      event.on('test', empty);
      event.on('test:more', empty);
      event.removeAllListeners('test');

      event.listeners('test').should().eql([]);
      event.listeners('test:more').should().eql([empty]);
    },

    'remove all listeners with no arguments': function () {
      var event = new io.EventEmitter;
      function empty () { }

      event.on('test', empty);
      event.on('test:more', empty);
      event.removeAllListeners();

      // TODO: with node 0.5 we'll change this to expect []
      event.listeners('test').should().eql([empty]);
      event.listeners('test:more').should().eql([empty]);
    },

    'remove listeners functions': function () {
      var event = new io.EventEmitter
        , calls = 0;

      function one () { ++calls }
      function two () { ++calls }<commit_msg>test: adapted test for EventEmitter update<commit_after>
/*!
 * socket.io-node
 * Copyright(c) 2011 LearnBoost <<EMAIL>>
 * MIT Licensed
 */

(function (module, io, should) {

  module.exports = {

    'add listeners': function () {
      var event = new io.EventEmitter
        , calls = 0;

      event.on('test', function (a, b) {
        ++calls;
        a.should().eql('a');
        b.should().eql('b');
      });

      event.emit('test', 'a', 'b');
      calls.should().eql(1);
      event.on.should().eql(event.addListener);
    },

    'remove listener': function () {
      var event = new io.EventEmitter;
      function empty () { }

      event.on('test', empty);
      event.on('test:more', empty);
      event.removeAllListeners('test');

      event.listeners('test').should().eql([]);
      event.listeners('test:more').should().eql([empty]);
    },

    'remove all listeners with no arguments': function () {
      var event = new io.EventEmitter;
      function empty () { }

      event.on('test', empty);
      event.on('test:more', empty);
      event.removeAllListeners();

      event.listeners('test').should().eql([]);
      event.listeners('test:more').should().eql([]);
    },

    'remove listeners functions': function () {
      var event = new io.EventEmitter
        , calls = 0;

      function one () { ++calls }
      function two () { ++calls }
{'fraction_non_alphanumeric': 0.18324420677361855, 'fraction_numerical': 0.00570409982174688, 'mean_word_length': 2.4813895781637716, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4077741', 'n_tokens_mistral': 879, 'n_tokens_neox': 861, 'n_words': 186}