mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 10:57:49 +00:00
Add _.gt, _.gte, _.lt, _.lte, & _.eq unit tests.
This commit is contained in:
76
test/test.js
76
test/test.js
@@ -6184,6 +6184,42 @@
|
|||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
QUnit.module('lodash.gt');
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
test('should return `true` if `value` is greater than `other`', 2, function() {
|
||||||
|
strictEqual(_.gt(3, 1), true);
|
||||||
|
strictEqual(_.gt('def', 'abc'), true);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('should return `false` if `value` is less than or equal to `other`', 4, function() {
|
||||||
|
strictEqual(_.gt(1, 3), false);
|
||||||
|
strictEqual(_.gt(3, 3), false);
|
||||||
|
strictEqual(_.gt('abc', 'def'), false);
|
||||||
|
strictEqual(_.gt('def', 'def'), false);
|
||||||
|
});
|
||||||
|
}());
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
QUnit.module('lodash.gte');
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
test('should return `true` if `value` is greater than or equal to `other`', 4, function() {
|
||||||
|
strictEqual(_.gte(3, 1), true);
|
||||||
|
strictEqual(_.gte(3, 3), true);
|
||||||
|
strictEqual(_.gte('def', 'abc'), true);
|
||||||
|
strictEqual(_.gte('def', 'def'), true);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('should return `false` if `value` is less than `other`', 2, function() {
|
||||||
|
strictEqual(_.gte(1, 3), false);
|
||||||
|
strictEqual(_.gte('abc', 'def'), false);
|
||||||
|
});
|
||||||
|
}());
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
QUnit.module('lodash.has');
|
QUnit.module('lodash.has');
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
@@ -7896,6 +7932,10 @@
|
|||||||
skipTest();
|
skipTest();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('should be aliased', 1, function() {
|
||||||
|
strictEqual(_.eq, _.isEqual);
|
||||||
|
});
|
||||||
}());
|
}());
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
@@ -9277,6 +9317,42 @@
|
|||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
QUnit.module('lodash.lt');
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
test('should return `true` if `value` is less than `other`', 2, function() {
|
||||||
|
strictEqual(_.lt(1, 3), true);
|
||||||
|
strictEqual(_.lt('abc', 'def'), true);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('should return `false` if `value` is greater than or equal to `other`', 4, function() {
|
||||||
|
strictEqual(_.lt(3, 1), false);
|
||||||
|
strictEqual(_.lt(3, 3), false);
|
||||||
|
strictEqual(_.lt('def', 'abc'), false);
|
||||||
|
strictEqual(_.lt('def', 'def'), false);
|
||||||
|
});
|
||||||
|
}());
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
QUnit.module('lodash.lte');
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
test('should return `true` if `value` is less than or equal to `other`', 4, function() {
|
||||||
|
strictEqual(_.lte(1, 3), true);
|
||||||
|
strictEqual(_.lte(3, 3), true);
|
||||||
|
strictEqual(_.lte('abc', 'def'), true);
|
||||||
|
strictEqual(_.lte('def', 'def'), true);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('should return `false` if `value` is greater than `other`', 2, function() {
|
||||||
|
strictEqual(_.lt(3, 1), false);
|
||||||
|
strictEqual(_.lt('def', 'abc'), false);
|
||||||
|
});
|
||||||
|
}());
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
QUnit.module('lodash.lastIndexOf');
|
QUnit.module('lodash.lastIndexOf');
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user