Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
lil5 committed Apr 3, 2024
1 parent 71c4179 commit 71690c1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/src/utils/wrap_index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ import wrapIndex from "./wrap_index";
test("should wrap index correctly", () => {
// prettier-ignore
const tests = [
{l: 3, i: 1, ex: 1},
{l: [1,2,3], i: 1, ex: 1},
{l: 3, i: 3, ex: 0},
{l: 3, i: 0, ex: 0},
{l: 3, i: 6, ex: 0},
{l: 3, i: 1, ex: 1},
{l: 3, i: 4, ex: 1},
{l: 3, i: -1, ex: 2},
]
for (const { l, i, ex } of tests) {
expect(wrapIndex(i, l)).toBe(ex);
Expand Down

0 comments on commit 71690c1

Please sign in to comment.