Add is.even() and is.odd() (#23)
This commit is contained in:
parent
00974a2fe9
commit
615932d6c2
3 changed files with 32 additions and 0 deletions
20
test.js
20
test.js
|
|
@ -419,6 +419,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