Add is.even() and is.odd()
This commit is contained in:
parent
dc3b6ff86b
commit
5d5555b809
3 changed files with 32 additions and 0 deletions
20
test.js
20
test.js
|
|
@ -409,6 +409,26 @@ test('is.infinite', t => {
|
|||
testType(t, 'infinite', ['number']);
|
||||
});
|
||||
|
||||
test('is.even', t => {
|
||||
for (const el of [-6, 2, 4]) {
|
||||
t.true(m.even(el));
|
||||
}
|
||||
|
||||
for (const el of [-3, 1, 5]) {
|
||||
t.false(m.even(el));
|
||||
}
|
||||
});
|
||||
|
||||
test('is.odd', t => {
|
||||
for (const el of [-5, 7, 13]) {
|
||||
t.true(m.odd(el));
|
||||
}
|
||||
|
||||
for (const el of [-8, 8, 10]) {
|
||||
t.false(m.odd(el));
|
||||
}
|
||||
});
|
||||
|
||||
test('is.empty', t => {
|
||||
t.true(m.empty(null));
|
||||
t.true(m.empty(undefined));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue