Add _.uniq unit test.

Former-commit-id: 29a09711863011681a45ae800502eca9a7022799
This commit is contained in:
John-David Dalton
2012-11-02 23:00:57 -07:00
parent a8ff5385dc
commit 16ab179e1d

View File

@@ -355,7 +355,7 @@
equal(_.every([true, null, true], _.identity), false);
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.extend');
@@ -785,14 +785,14 @@
equal(_.isFinite(' '), false);
equal(_.isFinite('2px'), false);
});
test('should return `true` for numeric string values', function() {
equal(_.isFinite('2'), true);
equal(_.isFinite('0'), true);
equal(_.isFinite('08'), true);
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.isObject');
@@ -1754,6 +1754,13 @@
deepEqual(actual, [1, 2, 3]);
});
test('should distinguish between numbers and numeric strings', function() {
var expected = ['2', 2, Object('2'), Object(2)],
actual = _.uniq(expected);
deepEqual(actual, expected);
});
}());
/*--------------------------------------------------------------------------*/