mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
Add _.parseInt test for its bizarro form.
This commit is contained in:
15
test/test.js
15
test/test.js
@@ -677,7 +677,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should avoid overwritten native methods', 13, function() {
|
test('should avoid overwritten native methods', 14, function() {
|
||||||
function Foo() {}
|
function Foo() {}
|
||||||
|
|
||||||
function message(lodashMethod, nativeMethod) {
|
function message(lodashMethod, nativeMethod) {
|
||||||
@@ -743,6 +743,13 @@
|
|||||||
}
|
}
|
||||||
deepEqual(actual, [[otherObject], [object], [object]], message('_.difference`, `_.intersection`, and `_.uniq', 'Set'));
|
deepEqual(actual, [[otherObject], [object], [object]], message('_.difference`, `_.intersection`, and `_.uniq', 'Set'));
|
||||||
|
|
||||||
|
try {
|
||||||
|
actual = _.map(['6', '08', '10'], lodashBizarro.parseInt);
|
||||||
|
} catch(e) {
|
||||||
|
actual = null;
|
||||||
|
}
|
||||||
|
deepEqual(actual, [6, 8, 10], '`_.parseInt` should work in its bizarro form');
|
||||||
|
|
||||||
if (ArrayBuffer) {
|
if (ArrayBuffer) {
|
||||||
try {
|
try {
|
||||||
var buffer = new ArrayBuffer(10);
|
var buffer = new ArrayBuffer(10);
|
||||||
@@ -772,7 +779,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest(13);
|
skipTest(14);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}());
|
}());
|
||||||
@@ -8802,8 +8809,8 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('should work as an iteratee for `_.map`', 2, function() {
|
test('should work as an iteratee for `_.map`', 2, function() {
|
||||||
var actual = _.map(['1', '10', '08'], _.parseInt);
|
var actual = _.map(['6', '08', '10'], _.parseInt);
|
||||||
deepEqual(actual, [1, 10, 8]);
|
deepEqual(actual, [6, 8, 10]);
|
||||||
|
|
||||||
actual = _.map('123', _.parseInt);
|
actual = _.map('123', _.parseInt);
|
||||||
deepEqual(actual, [1, 2, 3]);
|
deepEqual(actual, [1, 2, 3]);
|
||||||
|
|||||||
Reference in New Issue
Block a user