Add is.even() and is.odd()

This commit is contained in:
Brandon Smith 2017-10-17 07:39:00 -04:00
parent dc3b6ff86b
commit 5d5555b809
3 changed files with 32 additions and 0 deletions

20
test.js
View file

@ -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));