import { getIndexByReverseIndex } from "../index";

describe("getIndexByReverseIndex", () => {
  it("getIndexByReverseIndex", () => {
    expect(getIndexByReverseIndex(0, 5)).toBe(4);
    expect(getIndexByReverseIndex(1, 5)).toBe(3);
    expect(getIndexByReverseIndex(2, 5)).toBe(2);
    expect(getIndexByReverseIndex(3, 5)).toBe(1);
    expect(getIndexByReverseIndex(4, 5)).toBe(0);
    expect(getIndexByReverseIndex(5, 5)).toBe(-1);
    expect(getIndexByReverseIndex(6, 5)).toBe(-2);
  });
});
