Skip to content

Commit ef3164f

Browse files
committed
remove 'fasley' edge case tests
1 parent ba7b8f1 commit ef3164f

File tree

1 file changed

+1
-51
lines changed

1 file changed

+1
-51
lines changed

test/objects.js

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,6 @@
1515
deepEqual(_.keys(1), []);
1616
deepEqual(_.keys('a'), []);
1717
deepEqual(_.keys(true), []);
18-
19-
// keys that may be missed if the implementation isn't careful
20-
var trouble = {
21-
'constructor': Object,
22-
'valueOf': _.noop,
23-
'hasOwnProperty': null,
24-
'toString': 5,
25-
'toLocaleString': undefined,
26-
'propertyIsEnumerable': /a/,
27-
'isPrototypeOf': this,
28-
'__defineGetter__': Boolean,
29-
'__defineSetter__': {},
30-
'__lookupSetter__': false,
31-
'__lookupGetter__': []
32-
};
33-
var troubleKeys = ['constructor', 'valueOf', 'hasOwnProperty', 'toString', 'toLocaleString', 'propertyIsEnumerable',
34-
'isPrototypeOf', '__defineGetter__', '__defineSetter__', '__lookupSetter__', '__lookupGetter__'].sort();
35-
deepEqual(_.keys(trouble).sort(), troubleKeys, 'matches non-enumerable properties');
3618
});
3719

3820
test('allKeys', function() {
@@ -48,25 +30,11 @@
4830
deepEqual(_.allKeys(val), []);
4931
});
5032

51-
// allKeys that may be missed if the implementation isn't careful
52-
var trouble = {
53-
constructor: Object,
54-
valueOf: _.noop,
55-
hasOwnProperty: null,
56-
toString: 5,
57-
toLocaleString: undefined,
58-
propertyIsEnumerable: /a/,
59-
isPrototypeOf: this
60-
};
61-
var troubleKeys = ['constructor', 'valueOf', 'hasOwnProperty', 'toString', 'toLocaleString', 'propertyIsEnumerable',
62-
'isPrototypeOf'].sort();
63-
deepEqual(_.allKeys(trouble).sort(), troubleKeys, 'matches non-enumerable properties');
64-
6533
function A() {}
6634
A.prototype.foo = 'foo';
6735
var b = new A();
6836
b.bar = 'bar';
69-
deepEqual(_.allKeys(b), ['bar', 'foo'], 'should include inherited keys');
37+
deepEqual(_.allKeys(b).sort(), ['bar', 'foo'], 'should include inherited keys');
7038

7139
function y() {}
7240
y.x = 'z';
@@ -543,10 +511,6 @@
543511
var args = function(){ return arguments; };
544512
ok(_.isEmpty(args()), 'empty arguments object is empty');
545513
ok(!_.isEmpty(args('')), 'non-empty arguments object is not empty');
546-
547-
// covers collecting non-enumerable properties in IE < 9
548-
var nonEnumProp = {'toString': 5};
549-
ok(!_.isEmpty(nonEnumProp), 'non-enumerable property is not empty');
550514
});
551515

552516
if (typeof document === 'object') {
@@ -772,10 +736,6 @@
772736

773737
Prototest.x = 5;
774738
ok(_.isMatch({x: 5, y: 1}, Prototest), 'spec can be a function');
775-
776-
//null edge cases
777-
var oCon = {'constructor': Object};
778-
deepEqual(_.map([null, undefined, 5, {}], _.partial(_.isMatch, _, oCon)), [false, false, false, true], 'doesnt fasley match constructor on undefined/null');
779739
});
780740

781741
test('matcher', function() {
@@ -828,11 +788,6 @@
828788
o.b = 2;
829789
o.a = 1;
830790
equal(m({'b': 1}), true, 'changing spec object doesnt change matches result');
831-
832-
833-
//null edge cases
834-
var oCon = _.matcher({'constructor': Object});
835-
deepEqual(_.map([null, undefined, 5, {}], oCon), [false, false, false, true], 'doesnt fasley match constructor on undefined/null');
836791
});
837792

838793
test('matcher', function() {
@@ -885,11 +840,6 @@
885840
o.b = 2;
886841
o.a = 1;
887842
equal(m({'b': 1}), true, 'changing spec object doesnt change matches result');
888-
889-
890-
//null edge cases
891-
var oCon = _.matcher({'constructor': Object});
892-
deepEqual(_.map([null, undefined, 5, {}], oCon), [false, false, false, true], 'doesnt fasley match constructor on undefined/null');
893843
});
894844

895845
test('findKey', function() {

0 commit comments

Comments
 (0)