mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 08:07:50 +00:00
reverted _.buildLookup, restoring _.without to it's previous implementation, adding a test for object identity
This commit is contained in:
@@ -46,6 +46,10 @@ $(document).ready(function() {
|
||||
equals(_.without(list, 0, 1).join(', '), '2, 3, 4', 'can remove all instances of an object');
|
||||
var result = (function(){ return _.without(arguments, 0, 1); })(1, 2, 1, 0, 3, 1, 4);
|
||||
equals(result.join(', '), '2, 3, 4', 'works on an arguments object');
|
||||
|
||||
var list = [{one : 1}, {two : 2}];
|
||||
ok(_.without(list, {one : 1}).length == 2, 'uses real object identity for comparisons.');
|
||||
ok(_.without(list, list[0]).length == 1, 'ditto.');
|
||||
});
|
||||
|
||||
test("arrays: uniq", function() {
|
||||
|
||||
@@ -164,12 +164,5 @@ $(document).ready(function() {
|
||||
test('collections: size', function() {
|
||||
equals(_.size({one : 1, two : 2, three : 3}), 3, 'can compute the size of an object');
|
||||
});
|
||||
|
||||
test('collections: buildLookup', function() {
|
||||
same(_.buildLookup([1,'hi']), {1:true, 'hi':true}, 'defaults values to true');
|
||||
same(_.buildLookup([1,'hi'], 1), {1:1, 'hi':1}, 'can override value');
|
||||
same(_.buildLookup({5:'five'}), {five: true}, 'making a map from an object uses its values');
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
@@ -11,7 +11,7 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
test("objects: functions", function() {
|
||||
var expected = ["all", "any", "bind", "bindAll", "breakLoop", "buildLookup", "clone", "compact",
|
||||
var expected = ["all", "any", "bind", "bindAll", "breakLoop", "clone", "compact",
|
||||
"compose","defer", "delay", "detect", "each", "every", "extend", "filter", "first",
|
||||
"flatten", "foldl", "foldr", "forEach", "functions", "head", "identity", "include",
|
||||
"indexOf", "inject", "intersect", "invoke", "isArguments", "isArray", "isDate", "isElement", "isEmpty", "isEqual",
|
||||
|
||||
Reference in New Issue
Block a user