Add default 0 as lower bound if range is a number. Update tests

This commit is contained in:
glhrmv 2017-09-25 15:07:22 +01:00
parent be967d4d01
commit b30101d07e
3 changed files with 17 additions and 3 deletions

10
test.js
View file

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