Skip to content

Commit

Permalink
test: add negative values test
Browse files Browse the repository at this point in the history
  • Loading branch information
d4rkr00t committed Nov 29, 2023
1 parent 53d5bb5 commit 368eb4d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ test('percentile of simple values', t => {
});
});

test('percentile with negative values', t => {
t.is(percentile(50, shuffleArray([-1, -2, -3, -4, -5])), -3);
t.is(percentile(50, shuffleArray([7, 6, -1, -2, -3, -4, -5])), -2);
});

test('percentile of simple values in a typed array', t => {
stubsSimple.forEach(stub => {
t.is(
Expand Down

0 comments on commit 368eb4d

Please sign in to comment.