<commit_before>var module = QUnit.module,
	test = QUnit.test,
	obj;

function setup() {
	obj = {
		foo: function () {
			return 'bar';
		}
	};
}

module('Call Tracking', { setup: setup });

test('Basic Spy', function(assert) {
	var spy = Edgar.createSpy(obj, 'foo'),
		result = obj.foo();

	assert.ok(spy.called(), 'foo was called');
	assert.equal(result, undefined, 'spy returned undefined by default');
});

test('Return value', function(assert) {
	var value = 'stuff',
		spy = Edgar.createSpy(obj, 'foo', value),
		result = obj.foo();

	assert.ok(spy.called(), 'foo was called');
	assert.equal(result, value, 'spy returned value that was passed');
});

test('Return function', function(assert) {
	var value = 'stuff',
		func = function() { return value; },
		spy = Edgar.createSpy(obj, 'foo', func),
		result = obj.foo();

	assert.ok(spy.called(), 'foo was called');
	assert.equal(result, func, 'spy returned function that was passed');
	assert.equal(result(), value, 'returned function is unaltered');
});

test('Invoked function', function(assert) {
	var value = 'stuff',
		func = function() { return value; },
		spy = Edgar.createSpy(obj, 'foo', func).andInvoke(),
		result = obj.foo();

	assert.ok(spy.called(), 'foo was called');
	assert.equal(result, value, 'spy invoked function that was passed');
});

test('No mocking', function(assert) {
	var value = obj.foo(),
		spy = Edgar.createSpy(obj, 'foo').andExecute(),
		result = obj.foo();

	assert.ok(spy.called(), 'foo was called');
	assert.equal(result, value, 'spy executed the original function');
});

test('Multiple calls', function(assert) {
	var spy = Edgar.createSpy(obj, 'foo');

	obj.foo();
	assert.equal(spy.called(), 1, 'foo was called once');

	obj.foo();
	assert.equal(spy.called(), 2, 'foo was called twice');
});

module('Argument Tracking', { setup: setup });
<commit_msg>Add new failing test<commit_after>var module = QUnit.module,
	test = QUnit.test,
	obj;

function setup() {
	obj = {
		foo: function () {
			return 'bar';
		}
	};
}

module('Call Tracking', { setup: setup });

test('Basic Spy', function(assert) {
	var spy = Edgar.createSpy(obj, 'foo'),
		result = obj.foo();

	assert.ok(spy.called(), 'foo was called');
	assert.equal(result, undefined, 'spy returned undefined by default');
});

test('Return value', function(assert) {
	var value = 'stuff',
		spy = Edgar.createSpy(obj, 'foo', value),
		result = obj.foo();

	assert.ok(spy.called(), 'foo was called');
	assert.equal(result, value, 'spy returned value that was passed');
});

test('Return function', function(assert) {
	var value = 'stuff',
		func = function() { return value; },
		spy = Edgar.createSpy(obj, 'foo', func),
		result = obj.foo();

	assert.ok(spy.called(), 'foo was called');
	assert.equal(result, func, 'spy returned function that was passed');
	assert.equal(result(), value, 'returned function is unaltered');
});

test('Invoked function', function(assert) {
	var value = 'stuff',
		func = function() { return value; },
		spy = Edgar.createSpy(obj, 'foo', func).andInvoke(),
		result = obj.foo();

	assert.ok(spy.called(), 'foo was called');
	assert.equal(result, value, 'spy invoked function that was passed');
});

test('No mocking', function(assert) {
	var value = obj.foo(),
		spy = Edgar.createSpy(obj, 'foo').andExecute(),
		result = obj.foo();

	assert.ok(spy.called(), 'foo was called');
	assert.equal(result, value, 'spy executed the original function');
});

test('Multiple calls', function(assert) {
	var spy = Edgar.createSpy(obj, 'foo');

	obj.foo();
	assert.equal(spy.called(), 1, 'foo was called once');

	obj.foo();
	assert.equal(spy.called(), 2, 'foo was called twice');
});

test('Multiple spies', function(assert) {
	obj.bar = function () { return 'foo'; };

	var fooSpy = Edgar.createSpy(obj, 'foo'),
		barSpy = Edgar.createSpy(obj, 'bar'),
		val1 = 'thing',
		val2 = 'stuff';

	obj.foo(val1);
	obj.bar(val2);

	assert.equal(fooSpy.called(), 1, 'foo was called once');
	assert.equal(barSpy.called(), 1, 'bar was called once');
	assert.equal(fooSpy.calledWith()[0], val1, 'foo was called with val1');
	assert.equal(barSpy.calledWith()[0], val2, 'bar was called with val2');
});

module('Argument Tracking', { setup: setup });

{'fraction_non_alphanumeric': 0.18868821292775664, 'fraction_numerical': 0.0038022813688212928, 'mean_word_length': 4.680161943319838, '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': '4773949', 'n_tokens_mistral': 1511, 'n_tokens_neox': 1428, 'n_words': 389}