Add is.inRange() (#3)
This commit is contained in:
parent
119c41d39b
commit
3cbef48b6c
3 changed files with 28 additions and 0 deletions
13
test.js
13
test.js
|
|
@ -305,3 +305,16 @@ test('is.typedArray', t => {
|
|||
t.false(m.typedArray([]));
|
||||
t.false(m.typedArray({}));
|
||||
});
|
||||
|
||||
test('is.inRange', t => {
|
||||
const x = 3;
|
||||
|
||||
t.true(m.inRange(x, [0, 5]));
|
||||
t.true(m.inRange(x, [5, 0]));
|
||||
t.true(m.inRange(x, [-5, 5]));
|
||||
t.true(m.inRange(x, [5, -5]));
|
||||
t.false(m.inRange(x, [4, 8]));
|
||||
|
||||
t.true(m.inRange(x, 10));
|
||||
t.false(m.inRange(x, 2));
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue