Add default 0 as lower bound if range is a number. Update tests
This commit is contained in:
parent
be967d4d01
commit
b30101d07e
3 changed files with 17 additions and 3 deletions
10
test.js
10
test.js
|
|
@ -296,7 +296,13 @@ test('is.typedArray', t => {
|
|||
|
||||
test('is.inRange', t => {
|
||||
const x = 3;
|
||||
const arr = [0, 5];
|
||||
|
||||
t.true(m.inRange(x, arr));
|
||||
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