Cleanup -0 tests.

This commit is contained in:
John-David Dalton
2016-04-19 12:38:00 -07:00
parent 60c89b2754
commit f6bf8d2e6d

View File

@@ -17473,15 +17473,14 @@
assert.expect(1); assert.expect(1);
var object = { '-0': 'a', '0': 'b' }, var object = { '-0': 'a', '0': 'b' },
props = [-0, Object(-0), 0, Object(0)], props = [-0, Object(-0), 0, Object(0)];
expected = ['a', 'a', 'b', 'b'];
var actual = lodashStable.map(props, function(key) { var actual = lodashStable.map(props, function(key) {
var prop = _.property(key); var prop = _.property(key);
return prop(object); return prop(object);
}); });
assert.deepEqual(actual, expected); assert.deepEqual(actual, ['a', 'a', 'b', 'b']);
}); });
QUnit.test('should coerce key to a string', function(assert) { QUnit.test('should coerce key to a string', function(assert) {
@@ -17490,8 +17489,7 @@
function fn() {} function fn() {}
fn.toString = lodashStable.constant('fn'); fn.toString = lodashStable.constant('fn');
var expected = [1, 1, 2, 2, 3, 3, 4, 4], var objects = [{ 'null': 1 }, { 'undefined': 2 }, { 'fn': 3 }, { '[object Object]': 4 }],
objects = [{ 'null': 1 }, { 'undefined': 2 }, { 'fn': 3 }, { '[object Object]': 4 }],
values = [null, undefined, fn, {}]; values = [null, undefined, fn, {}];
var actual = lodashStable.transform(objects, function(result, object, index) { var actual = lodashStable.transform(objects, function(result, object, index) {
@@ -17502,7 +17500,7 @@
}); });
}); });
assert.deepEqual(actual, expected); assert.deepEqual(actual, [1, 1, 2, 2, 3, 3, 4, 4]);
}); });
QUnit.test('should pluck a key over a path', function(assert) { QUnit.test('should pluck a key over a path', function(assert) {
@@ -17620,15 +17618,14 @@
assert.expect(1); assert.expect(1);
var object = { '-0': 'a', '0': 'b' }, var object = { '-0': 'a', '0': 'b' },
props = [-0, Object(-0), 0, Object(0)], props = [-0, Object(-0), 0, Object(0)];
expected = ['a', 'a', 'b', 'b'];
var actual = lodashStable.map(props, function(key) { var actual = lodashStable.map(props, function(key) {
var propOf = _.propertyOf(object); var propOf = _.propertyOf(object);
return propOf(key); return propOf(key);
}); });
assert.deepEqual(actual, expected); assert.deepEqual(actual, ['a', 'a', 'b', 'b']);
}); });
QUnit.test('should coerce key to a string', function(assert) { QUnit.test('should coerce key to a string', function(assert) {
@@ -17637,8 +17634,7 @@
function fn() {} function fn() {}
fn.toString = lodashStable.constant('fn'); fn.toString = lodashStable.constant('fn');
var expected = [1, 1, 2, 2, 3, 3, 4, 4], var objects = [{ 'null': 1 }, { 'undefined': 2 }, { 'fn': 3 }, { '[object Object]': 4 }],
objects = [{ 'null': 1 }, { 'undefined': 2 }, { 'fn': 3 }, { '[object Object]': 4 }],
values = [null, undefined, fn, {}]; values = [null, undefined, fn, {}];
var actual = lodashStable.transform(objects, function(result, object, index) { var actual = lodashStable.transform(objects, function(result, object, index) {
@@ -17649,7 +17645,7 @@
}); });
}); });
assert.deepEqual(actual, expected); assert.deepEqual(actual, [1, 1, 2, 2, 3, 3, 4, 4]);
}); });
QUnit.test('should pluck a key over a path', function(assert) { QUnit.test('should pluck a key over a path', function(assert) {
@@ -18842,14 +18838,13 @@
assert.expect(1); assert.expect(1);
var object = { '-0': 'a', '0': 'b' }, var object = { '-0': 'a', '0': 'b' },
props = [-0, Object(-0), 0, Object(0)], props = [-0, Object(-0), 0, Object(0)];
expected = ['a', 'a', 'b', 'b'];
var actual = lodashStable.map(props, function(key) { var actual = lodashStable.map(props, function(key) {
return func(object, key); return func(object, key);
}); });
assert.deepEqual(actual, expected); assert.deepEqual(actual, ['a', 'a', 'b', 'b']);
}); });
QUnit.test('`_.' + methodName + '` should get symbol keyed property values', function(assert) { QUnit.test('`_.' + methodName + '` should get symbol keyed property values', function(assert) {