<commit_before>/**
 * EventEmitter tests
 */

(function() {
	test('Adding and retrieving listeners', function() {
		var ee = new EventEmitter();
		
		equal(ee.listeners('testEvent').length, 0, 'Checking for any listeners');
		
		ee.addListener('testEvent', function() {
			// Listener
			return true;
		});
		equal(ee.listeners('testEvent')[0](), true, 'Retrieving the first listener');
		
		ee.addListener('testEvent', function() {
			// Another listener for the same event
			return true;
		});
		equal(ee.listeners('testEvent')[1](), true, 'Retrieving the second listener');
		
		ee.addListener('anotherTestEvent', function() {
			// Listener for new event
			return true;
		});
		equal(ee.listeners('anotherTestEvent')[0](), true, 'Retrieving the first listener for a different event');
		
		ee.addListener('anotherTestEvent', function() {
			// Another listener for new event
			return true;
		});
		equal(ee.listeners('anotherTestEvent')[1](), true, 'Retrieving the second listener for a different event');
		
		ee.addListener('onTest', function() {
			// Listener via the alias
			return true;
		});
		equal(ee.listeners('onTest')[0](), true, 'Retrieving the first listener for a different event added via the on alias');
	});
	
	test('Removing listeners', function() {
		var ee = new EventEmitter();
		
		function testListener() {
			// Listener
			return true;<commit_msg>Made the alias test actually use the alias.<commit_after>/**
 * EventEmitter tests
 */

(function() {
	test('Adding and retrieving listeners', function() {
		var ee = new EventEmitter();
		
		equal(ee.listeners('testEvent').length, 0, 'Checking for any listeners');
		
		ee.addListener('testEvent', function() {
			// Listener
			return true;
		});
		equal(ee.listeners('testEvent')[0](), true, 'Retrieving the first listener');
		
		ee.addListener('testEvent', function() {
			// Another listener for the same event
			return true;
		});
		equal(ee.listeners('testEvent')[1](), true, 'Retrieving the second listener');
		
		ee.addListener('anotherTestEvent', function() {
			// Listener for new event
			return true;
		});
		equal(ee.listeners('anotherTestEvent')[0](), true, 'Retrieving the first listener for a different event');
		
		ee.addListener('anotherTestEvent', function() {
			// Another listener for new event
			return true;
		});
		equal(ee.listeners('anotherTestEvent')[1](), true, 'Retrieving the second listener for a different event');
		
		ee.on('onTest', function() {
			// Listener via the alias
			return true;
		});
		equal(ee.listeners('onTest')[0](), true, 'Retrieving the first listener for a different event added via the on alias');
	});
	
	test('Removing listeners', function() {
		var ee = new EventEmitter();
		
		function testListener() {
			// Listener
			return true;
{'fraction_non_alphanumeric': 0.1491196550485088, 'fraction_numerical': 0.004311893639956881, 'mean_word_length': 4.052631578947368, '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': '3771854', 'n_tokens_mistral': 958, 'n_tokens_neox': 815, 'n_words': 242}