<commit_before>(function(buster, when) {

var assert, refute, fail;

assert = buster.assert;
refute = buster.refute;
fail = buster.assertions.fail;

buster.testCase('when.chain', {
	'should return a promise for an input value': function() {
		var d, result;

		d = when.defer();

		result = when.chain(1, d.resolver);

		assert(typeof result.then == 'function');
		refute.equals(result, d);
		refute.equals(result, d.promise);
	},

	'should return a promise for an input promise': function() {
		var d1, d2, result;

		d1 = when.defer();
		d2 = when.defer();

		result = when.chain(d1.promise, d2.resolver);

		assert(typeof result.then == 'function');
		refute.equals(result, d1);
		refute.equals(result, d1.promise);
		refute.equals(result, d2);
		refute.equals(result, d2.promise);
	},

	'should resolve resolver with input value': function(done) {
		var d = when.defer();

		d.promise.then(
			function(val) { assert.equals(val, 1); },
			function() { fail('promise should not have rejected'); }
		).always(done);

		when.chain(1, d.resolver);
	},

	'should resolve resolver with input promise value': function(done) {
		var d, input;

		d = when.defer();

		d.promise.then(
			function(val) { assert.equals(val, 1); },
			function() { fail('promise should not have rejected'); }
		).always(done);

		input = when.defer();
		input.resolve(1);

		when.chain(input.promise, d.resolver);<commit_msg>Use assert.same instead of assert.equals because thats what we really mean<commit_after>(function(buster, when) {

var assert, refute, fail;

assert = buster.assert;
refute = buster.refute;
fail = buster.assertions.fail;

buster.testCase('when.chain', {
	'should return a promise for an input value': function() {
		var d, result;

		d = when.defer();

		result = when.chain(1, d.resolver);

		assert(typeof result.then == 'function');
		refute.same(result, d);
		refute.same(result, d.promise);
	},

	'should return a promise for an input promise': function() {
		var d1, d2, result;

		d1 = when.defer();
		d2 = when.defer();

		result = when.chain(d1.promise, d2.resolver);

		assert(typeof result.then == 'function');
		refute.same(result, d1);
		refute.same(result, d1.promise);
		refute.same(result, d2);
		refute.same(result, d2.promise);
	},

	'should resolve resolver with input value': function(done) {
		var d = when.defer();

		d.promise.then(
			function(val) { assert.equals(val, 1); },
			function() { fail('promise should not have rejected'); }
		).always(done);

		when.chain(1, d.resolver);
	},

	'should resolve resolver with input promise value': function(done) {
		var d, input;

		d = when.defer();

		d.promise.then(
			function(val) { assert.equals(val, 1); },
			function() { fail('promise should not have rejected'); }
		).always(done);

		input = when.defer();
		input.resolve(1);

		when.chain(input.promise, d.resolver);
{'fraction_non_alphanumeric': 0.16216216216216217, 'fraction_numerical': 0.01053001053001053, 'mean_word_length': 3.973821989528796, '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': '565689', 'n_tokens_mistral': 1089, 'n_tokens_neox': 994, 'n_words': 249}