// Generated by ReScript, PLEASE EDIT WITH CARE

import * as Mocha from "mocha";
import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs";
import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs";
import * as Test_utils from "./test_utils.mjs";
import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs";
import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs";

function push(prim0, prim1) {
  prim0.push(prim1);
}

console.log([
  1,
  2,
  3,
  4
].filter(x => x > 2).map((x, i) => x + i | 0).reduce((x, y) => x + y | 0, 0));

Mocha.describe("Bs_array_test", () => {
  Mocha.test("bs_array_test_1", () => {
    let v = [
      1,
      2
    ];
    Test_utils.eq("File \"bs_array_test.res\", line 21, characters 6-13", [
      Belt_Array.get(v, 0),
      Belt_Array.get(v, 1),
      Belt_Array.get(v, 2),
      Belt_Array.get(v, 3),
      Belt_Array.get(v, -1)
    ], [
      1,
      2,
      undefined,
      undefined,
      undefined
    ]);
    Test_utils.throws("File \"bs_array_test.res\", line 25, characters 11-18", () => {
      Belt_Array.getExn([
        0,
        1
      ], -1);
    });
    Test_utils.throws("File \"bs_array_test.res\", line 26, characters 11-18", () => {
      Belt_Array.getExn([
        0,
        1
      ], 2);
    });
    let f = extra => Belt_Array.getExn([
      0,
      1
    ], extra);
    Test_utils.ok("File \"bs_array_test.res\", line 28, characters 6-13", Primitive_object.equal([
      f(0),
      f(1)
    ], [
      0,
      1
    ]));
    Test_utils.throws("File \"bs_array_test.res\", line 34, characters 11-18", () => Belt_Array.setExn([
      0,
      1
    ], -1, 0));
    Test_utils.throws("File \"bs_array_test.res\", line 35, characters 11-18", () => Belt_Array.setExn([
      0,
      1
    ], 2, 0));
    Test_utils.ok("File \"bs_array_test.res\", line 36, characters 7-14", !Belt_Array.set([
      1,
      2
    ], 2, 0));
    let v$1 = [
      1,
      2
    ];
    if (!Belt_Array.set(v$1, 0, 0)) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_array_test.res",
          41,
          8
        ],
        Error: new Error()
      };
    }
    Test_utils.ok("File \"bs_array_test.res\", line 38, characters 6-13", Belt_Array.getExn(v$1, 0) === 0);
    let v$2 = [
      1,
      2
    ];
    if (!Belt_Array.set(v$2, 1, 0)) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_array_test.res",
          49,
          8
        ],
        Error: new Error()
      };
    }
    Test_utils.ok("File \"bs_array_test.res\", line 46, characters 6-13", Belt_Array.getExn(v$2, 1) === 0);
    let v$3 = [
      1,
      2
    ];
    Test_utils.ok("File \"bs_array_test.res\", line 54, characters 6-13", (Belt_Array.setExn(v$3, 0, 0), Belt_Array.getExn(v$3, 0) === 0));
    let v$4 = [
      1,
      2
    ];
    Test_utils.ok("File \"bs_array_test.res\", line 62, characters 6-13", (Belt_Array.setExn(v$4, 1, 0), Belt_Array.getExn(v$4, 1) === 0));
  });
  let add = (x, y) => x + y | 0;
  Mocha.test("bs_array_test_2", () => {
    let v = Belt_Array.makeBy(3000, i => i);
    let u = Belt_Array.shuffle(v);
    Test_utils.ok("File \"bs_array_test.res\", line 75, characters 7-14", u !== v);
    Test_utils.eq("File \"bs_array_test.res\", line 77, characters 7-14", Belt_Array.reduce(u, 0, add), Belt_Array.reduce(v, 0, add));
  });
  Mocha.test("bs_array_test_3", () => {
    Test_utils.ok("File \"bs_array_test.res\", line 82, characters 7-14", Primitive_object.equal(Belt_Array.range(0, 3), [
      0,
      1,
      2,
      3
    ]));
    Test_utils.ok("File \"bs_array_test.res\", line 83, characters 7-14", Primitive_object.equal(Belt_Array.range(3, 0), []));
    Test_utils.ok("File \"bs_array_test.res\", line 84, characters 7-14", Primitive_object.equal(Belt_Array.range(3, 3), [3]));
    Test_utils.ok("File \"bs_array_test.res\", line 86, characters 7-14", Primitive_object.equal(Belt_Array.rangeBy(0, 10, 3), [
      0,
      3,
      6,
      9
    ]));
    Test_utils.ok("File \"bs_array_test.res\", line 87, characters 7-14", Primitive_object.equal(Belt_Array.rangeBy(0, 12, 3), [
      0,
      3,
      6,
      9,
      12
    ]));
    Test_utils.ok("File \"bs_array_test.res\", line 88, characters 7-14", Primitive_object.equal(Belt_Array.rangeBy(33, 0, 1), []));
    Test_utils.ok("File \"bs_array_test.res\", line 89, characters 7-14", Primitive_object.equal(Belt_Array.rangeBy(33, 0, -1), []));
    Test_utils.ok("File \"bs_array_test.res\", line 90, characters 7-14", Primitive_object.equal(Belt_Array.rangeBy(3, 12, -1), []));
    Test_utils.ok("File \"bs_array_test.res\", line 91, characters 7-14", Primitive_object.equal(Belt_Array.rangeBy(3, 3, 0), []));
    Test_utils.ok("File \"bs_array_test.res\", line 92, characters 7-14", Primitive_object.equal(Belt_Array.rangeBy(3, 3, 1), [3]));
  });
  Mocha.test("bs_array_test_4", () => {
    Test_utils.eq("File \"bs_array_test.res\", line 96, characters 7-14", Belt_Array.reduceReverse([], 100, (a, b) => a - b | 0), 100);
    Test_utils.eq("File \"bs_array_test.res\", line 97, characters 7-14", Belt_Array.reduceReverse([
      1,
      2
    ], 100, (a, b) => a - b | 0), 97);
    Test_utils.eq("File \"bs_array_test.res\", line 98, characters 7-14", Belt_Array.reduceReverse([
      1,
      2,
      3,
      4
    ], 100, (a, b) => a - b | 0), 90);
    Test_utils.eq("File \"bs_array_test.res\", line 99, characters 7-14", Belt_Array.reduceWithIndex([
      1,
      2,
      3,
      4
    ], 0, (acc, x, i) => (acc + x | 0) + i | 0), 16);
    Test_utils.ok("File \"bs_array_test.res\", line 100, characters 7-14", Belt_Array.reduceReverse2([
      1,
      2,
      3
    ], [
      1,
      2
    ], 0, (acc, x, y) => (acc + x | 0) + y | 0) === 6);
  });
  let makeMatrixExn = (sx, sy, init) => {
    if (!(sx >= 0 && sy >= 0)) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_array_test.res",
          106,
          4
        ],
        Error: new Error()
      };
    }
    let res = new Array(sx);
    for (let x = 0; x < sx; ++x) {
      let initY = new Array(sy);
      for (let y = 0; y < sy; ++y) {
        initY[y] = init;
      }
      res[x] = initY;
    }
    return res;
  };
  Mocha.test("bs_array_test_make_functions", () => {
    Test_utils.eq("File \"bs_array_test.res\", line 119, characters 7-14", Belt_Array.makeBy(0, param => 1), []);
    Test_utils.eq("File \"bs_array_test.res\", line 120, characters 7-14", Belt_Array.makeBy(3, i => i), [
      0,
      1,
      2
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 121, characters 7-14", makeMatrixExn(3, 4, 1), [
      [
        1,
        1,
        1,
        1
      ],
      [
        1,
        1,
        1,
        1
      ],
      [
        1,
        1,
        1,
        1
      ]
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 122, characters 7-14", makeMatrixExn(3, 0, 0), [
      [],
      [],
      []
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 123, characters 7-14", makeMatrixExn(0, 3, 1), []);
    Test_utils.eq("File \"bs_array_test.res\", line 124, characters 7-14", makeMatrixExn(1, 1, 1), [[1]]);
    Test_utils.eq("File \"bs_array_test.res\", line 125, characters 7-14", [].slice(0), []);
    Test_utils.eq("File \"bs_array_test.res\", line 126, characters 7-14", Belt_Array.map([], prim => prim + 1 | 0), []);
    Test_utils.eq("File \"bs_array_test.res\", line 127, characters 7-14", Belt_Array.mapWithIndex([], add), []);
    Test_utils.eq("File \"bs_array_test.res\", line 128, characters 7-14", Belt_Array.mapWithIndex([
      1,
      2,
      3
    ], add), [
      1,
      3,
      5
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 129, characters 7-14", Belt_List.fromArray([]), /* [] */0);
    Test_utils.eq("File \"bs_array_test.res\", line 130, characters 7-14", Belt_List.fromArray([1]), {
      hd: 1,
      tl: /* [] */0
    });
    Test_utils.eq("File \"bs_array_test.res\", line 131, characters 7-14", Belt_List.fromArray([
      1,
      2,
      3
    ]), {
      hd: 1,
      tl: {
        hd: 2,
        tl: {
          hd: 3,
          tl: /* [] */0
        }
      }
    });
    Test_utils.eq("File \"bs_array_test.res\", line 132, characters 7-14", Belt_Array.map([
      1,
      2,
      3
    ], prim => prim + 1 | 0), [
      2,
      3,
      4
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 133, characters 7-14", Belt_List.toArray(/* [] */0), []);
    Test_utils.eq("File \"bs_array_test.res\", line 134, characters 7-14", Belt_List.toArray({
      hd: 1,
      tl: /* [] */0
    }), [1]);
    Test_utils.eq("File \"bs_array_test.res\", line 135, characters 7-14", Belt_List.toArray({
      hd: 1,
      tl: {
        hd: 2,
        tl: /* [] */0
      }
    }), [
      1,
      2
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 136, characters 7-14", Belt_List.toArray({
      hd: 1,
      tl: {
        hd: 2,
        tl: {
          hd: 3,
          tl: /* [] */0
        }
      }
    }), [
      1,
      2,
      3
    ]);
  });
  Mocha.test("bs_array_test_keep_functions", () => {
    let v = Belt_Array.makeBy(10, i => i);
    let v0 = Belt_Array.keep(v, x => x % 2 === 0);
    let v1 = Belt_Array.keep(v, x => x % 3 === 0);
    let v2 = Belt_Array.keepMap(v, x => {
      if (x % 2 === 0) {
        return x + 1 | 0;
      }
    });
    Test_utils.eq("File \"bs_array_test.res\", line 152, characters 7-14", v0, [
      0,
      2,
      4,
      6,
      8
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 153, characters 7-14", v1, [
      0,
      3,
      6,
      9
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 154, characters 7-14", v2, [
      1,
      3,
      5,
      7,
      9
    ]);
  });
  Mocha.test("bs_array_test_partition", () => {
    let a = [
      1,
      2,
      3,
      4,
      5
    ];
    let match = Belt_Array.partition(a, x => x % 2 === 0);
    Test_utils.eq("File \"bs_array_test.res\", line 160, characters 7-14", match[0], [
      2,
      4
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 161, characters 7-14", match[1], [
      1,
      3,
      5
    ]);
    let match$1 = Belt_Array.partition(a, x => x === 2);
    Test_utils.eq("File \"bs_array_test.res\", line 163, characters 7-14", match$1[0], [2]);
    Test_utils.eq("File \"bs_array_test.res\", line 164, characters 7-14", match$1[1], [
      1,
      3,
      4,
      5
    ]);
    let match$2 = Belt_Array.partition([], x => false);
    Test_utils.eq("File \"bs_array_test.res\", line 166, characters 7-14", match$2[0], []);
    Test_utils.eq("File \"bs_array_test.res\", line 167, characters 7-14", match$2[1], []);
  });
  Mocha.test("bs_array_test_slice_functions", () => {
    let a = [
      1,
      2,
      3,
      4,
      5
    ];
    Test_utils.eq("File \"bs_array_test.res\", line 172, characters 7-14", Belt_Array.slice(a, 0, 2), [
      1,
      2
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 173, characters 7-14", Belt_Array.slice(a, 0, 5), [
      1,
      2,
      3,
      4,
      5
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 174, characters 7-14", Belt_Array.slice(a, 0, 15), [
      1,
      2,
      3,
      4,
      5
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 175, characters 7-14", Belt_Array.slice(a, 5, 1), []);
    Test_utils.eq("File \"bs_array_test.res\", line 176, characters 7-14", Belt_Array.slice(a, 4, 1), [5]);
    Test_utils.eq("File \"bs_array_test.res\", line 177, characters 7-14", Belt_Array.slice(a, -1, 1), [5]);
    Test_utils.eq("File \"bs_array_test.res\", line 178, characters 7-14", Belt_Array.slice(a, -1, 2), [5]);
    Test_utils.eq("File \"bs_array_test.res\", line 179, characters 7-14", Belt_Array.slice(a, -2, 1), [4]);
    Test_utils.eq("File \"bs_array_test.res\", line 180, characters 7-14", Belt_Array.slice(a, -2, 2), [
      4,
      5
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 181, characters 7-14", Belt_Array.slice(a, -2, 3), [
      4,
      5
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 182, characters 7-14", Belt_Array.slice(a, -10, 3), [
      1,
      2,
      3
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 183, characters 7-14", Belt_Array.slice(a, -10, 4), [
      1,
      2,
      3,
      4
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 184, characters 7-14", Belt_Array.slice(a, -10, 5), [
      1,
      2,
      3,
      4,
      5
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 185, characters 7-14", Belt_Array.slice(a, -10, 6), [
      1,
      2,
      3,
      4,
      5
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 186, characters 7-14", Belt_Array.slice(a, 0, 0), []);
    Test_utils.eq("File \"bs_array_test.res\", line 187, characters 7-14", Belt_Array.slice(a, 0, -1), []);
  });
  Mocha.test("bs_array_test_sliceToEnd_functions", () => {
    let a = [
      1,
      2,
      3,
      4,
      5
    ];
    Test_utils.eq("File \"bs_array_test.res\", line 192, characters 7-14", Belt_Array.sliceToEnd(a, 0), [
      1,
      2,
      3,
      4,
      5
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 193, characters 7-14", Belt_Array.sliceToEnd(a, 5), []);
    Test_utils.eq("File \"bs_array_test.res\", line 194, characters 7-14", Belt_Array.sliceToEnd(a, 4), [5]);
    Test_utils.eq("File \"bs_array_test.res\", line 195, characters 7-14", Belt_Array.sliceToEnd(a, -1), [5]);
    Test_utils.eq("File \"bs_array_test.res\", line 196, characters 7-14", Belt_Array.sliceToEnd(a, -2), [
      4,
      5
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 197, characters 7-14", Belt_Array.sliceToEnd(a, -10), [
      1,
      2,
      3,
      4,
      5
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 198, characters 7-14", Belt_Array.sliceToEnd(a, 6), []);
  });
  Mocha.test("bs_array_test_fill_functions", () => {
    let a = Belt_Array.makeBy(10, x => x);
    Belt_Array.fill(a, 0, 3, 0);
    Test_utils.eq("File \"bs_array_test.res\", line 204, characters 7-14", a.slice(0), [
      0,
      0,
      0,
      3,
      4,
      5,
      6,
      7,
      8,
      9
    ]);
    Belt_Array.fill(a, 2, 8, 1);
    Test_utils.eq("File \"bs_array_test.res\", line 206, characters 7-14", a.slice(0), [
      0,
      0,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1
    ]);
    Belt_Array.fill(a, 8, 1, 9);
    Test_utils.eq("File \"bs_array_test.res\", line 208, characters 7-14", a.slice(0), [
      0,
      0,
      1,
      1,
      1,
      1,
      1,
      1,
      9,
      1
    ]);
    Belt_Array.fill(a, 8, 2, 9);
    Test_utils.eq("File \"bs_array_test.res\", line 210, characters 7-14", a.slice(0), [
      0,
      0,
      1,
      1,
      1,
      1,
      1,
      1,
      9,
      9
    ]);
    Belt_Array.fill(a, 8, 3, 12);
    Test_utils.eq("File \"bs_array_test.res\", line 212, characters 7-14", a.slice(0), [
      0,
      0,
      1,
      1,
      1,
      1,
      1,
      1,
      12,
      12
    ]);
    Belt_Array.fill(a, -2, 3, 11);
    Test_utils.eq("File \"bs_array_test.res\", line 214, characters 7-14", a.slice(0), [
      0,
      0,
      1,
      1,
      1,
      1,
      1,
      1,
      11,
      11
    ]);
    Belt_Array.fill(a, -3, 3, 10);
    Test_utils.eq("File \"bs_array_test.res\", line 216, characters 7-14", a.slice(0), [
      0,
      0,
      1,
      1,
      1,
      1,
      1,
      10,
      10,
      10
    ]);
    Belt_Array.fill(a, -3, 1, 7);
    Test_utils.eq("File \"bs_array_test.res\", line 218, characters 7-14", a.slice(0), [
      0,
      0,
      1,
      1,
      1,
      1,
      1,
      7,
      10,
      10
    ]);
    Belt_Array.fill(a, -13, 1, 7);
    Test_utils.eq("File \"bs_array_test.res\", line 220, characters 7-14", a.slice(0), [
      7,
      0,
      1,
      1,
      1,
      1,
      1,
      7,
      10,
      10
    ]);
    Belt_Array.fill(a, -13, 12, 7);
    Test_utils.eq("File \"bs_array_test.res\", line 222, characters 7-14", a.slice(0), Belt_Array.make(10, 7));
    Belt_Array.fill(a, 0, -1, 2);
    Test_utils.eq("File \"bs_array_test.res\", line 224, characters 7-14", a.slice(0), Belt_Array.make(10, 7));
    let b = [
      1,
      2,
      3
    ];
    Belt_Array.fill(b, 0, 0, 0);
    Test_utils.eq("File \"bs_array_test.res\", line 227, characters 7-14", b, [
      1,
      2,
      3
    ]);
    Belt_Array.fill(b, 4, 1, 0);
    Test_utils.eq("File \"bs_array_test.res\", line 229, characters 7-14", b, [
      1,
      2,
      3
    ]);
  });
  Mocha.test("bs_array_test_blit_functions", () => {
    let a0 = Belt_Array.makeBy(10, x => x);
    let b0 = Belt_Array.make(10, 3);
    Belt_Array.blit(a0, 1, b0, 2, 5);
    Test_utils.eq("File \"bs_array_test.res\", line 236, characters 7-14", b0.slice(0), [
      3,
      3,
      1,
      2,
      3,
      4,
      5,
      3,
      3,
      3
    ]);
    Belt_Array.blit(a0, -1, b0, 2, 5);
    Test_utils.eq("File \"bs_array_test.res\", line 238, characters 7-14", b0.slice(0), [
      3,
      3,
      9,
      2,
      3,
      4,
      5,
      3,
      3,
      3
    ]);
    Belt_Array.blit(a0, -1, b0, -2, 5);
    Test_utils.eq("File \"bs_array_test.res\", line 240, characters 7-14", b0.slice(0), [
      3,
      3,
      9,
      2,
      3,
      4,
      5,
      3,
      9,
      3
    ]);
    Belt_Array.blit(a0, -2, b0, -2, 2);
    Test_utils.eq("File \"bs_array_test.res\", line 242, characters 7-14", b0.slice(0), [
      3,
      3,
      9,
      2,
      3,
      4,
      5,
      3,
      8,
      9
    ]);
    Belt_Array.blit(a0, -11, b0, -11, 100);
    Test_utils.eq("File \"bs_array_test.res\", line 244, characters 7-14", b0.slice(0), a0);
    Belt_Array.blit(a0, -11, b0, -11, 2);
    Test_utils.eq("File \"bs_array_test.res\", line 246, characters 7-14", b0.slice(0), a0);
    let aa = Belt_Array.makeBy(10, x => x);
    Belt_Array.blit(aa, -1, aa, 1, 2);
    Test_utils.eq("File \"bs_array_test.res\", line 249, characters 7-14", aa.slice(0), [
      0,
      9,
      2,
      3,
      4,
      5,
      6,
      7,
      8,
      9
    ]);
    Belt_Array.blit(aa, -2, aa, 1, 2);
    Test_utils.eq("File \"bs_array_test.res\", line 251, characters 7-14", aa.slice(0), [
      0,
      8,
      9,
      3,
      4,
      5,
      6,
      7,
      8,
      9
    ]);
    Belt_Array.blit(aa, -5, aa, 4, 3);
    Test_utils.eq("File \"bs_array_test.res\", line 253, characters 7-14", aa.slice(0), [
      0,
      8,
      9,
      3,
      5,
      6,
      7,
      7,
      8,
      9
    ]);
    Belt_Array.blit(aa, 4, aa, 5, 3);
    Test_utils.eq("File \"bs_array_test.res\", line 255, characters 7-14", aa.slice(0), [
      0,
      8,
      9,
      3,
      5,
      5,
      6,
      7,
      8,
      9
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 256, characters 7-14", Belt_Array.make(0, 3), []);
    Test_utils.eq("File \"bs_array_test.res\", line 257, characters 7-14", Belt_Array.make(-1, 3), []);
    let c = [
      0,
      1,
      2
    ];
    Belt_Array.blit(c, 4, c, 1, 1);
    Test_utils.eq("File \"bs_array_test.res\", line 260, characters 7-14", c, [
      0,
      1,
      2
    ]);
  });
  Mocha.test("bs_array_test_zip_functions", () => {
    Test_utils.eq("File \"bs_array_test.res\", line 264, characters 7-14", Belt_Array.zip([
      1,
      2,
      3
    ], [
      2,
      3,
      4,
      1
    ]), [
      [
        1,
        2
      ],
      [
        2,
        3
      ],
      [
        3,
        4
      ]
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 265, characters 7-14", Belt_Array.zip([
      2,
      3,
      4,
      1
    ], [
      1,
      2,
      3
    ]), [
      [
        2,
        1
      ],
      [
        3,
        2
      ],
      [
        4,
        3
      ]
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 266, characters 7-14", Belt_Array.zipBy([
      2,
      3,
      4,
      1
    ], [
      1,
      2,
      3
    ], (prim0, prim1) => prim0 - prim1 | 0), [
      1,
      1,
      1
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 267, characters 7-14", Belt_Array.zipBy([
      1,
      2,
      3
    ], [
      2,
      3,
      4,
      1
    ], (prim0, prim1) => prim0 - prim1 | 0), Belt_Array.map([
      1,
      1,
      1
    ], x => -x | 0));
    Test_utils.eq("File \"bs_array_test.res\", line 268, characters 7-14", Belt_Array.unzip([
      [
        1,
        2
      ],
      [
        2,
        3
      ],
      [
        3,
        4
      ]
    ]), [
      [
        1,
        2,
        3
      ],
      [
        2,
        3,
        4
      ]
    ]);
  });
  let sumUsingForEach = xs => {
    let v = {
      contents: 0
    };
    Belt_Array.forEach(xs, x => {
      v.contents = v.contents + x | 0;
    });
    return v.contents;
  };
  Mocha.test("bs_array_test_iteration_functions", () => {
    Test_utils.eq("File \"bs_array_test.res\", line 280, characters 7-14", sumUsingForEach([
      0,
      1,
      2,
      3,
      4
    ]), 10);
    Test_utils.ok("File \"bs_array_test.res\", line 281, characters 7-14", !Belt_Array.every([
      0,
      1,
      2,
      3,
      4
    ], x => x > 2));
    Test_utils.ok("File \"bs_array_test.res\", line 282, characters 7-14", Belt_Array.some([
      1,
      3,
      7,
      8
    ], x => x % 2 === 0));
    Test_utils.ok("File \"bs_array_test.res\", line 283, characters 7-14", !Belt_Array.some([
      1,
      3,
      7
    ], x => x % 2 === 0));
    Test_utils.ok("File \"bs_array_test.res\", line 284, characters 7-14", !Belt_Array.eq([
      0,
      1
    ], [1], (prim0, prim1) => prim0 === prim1));
    let c = {
      contents: 0
    };
    Test_utils.ok("File \"bs_array_test.res\", line 286, characters 6-13", (Belt_Array.forEachWithIndex([
      1,
      1,
      1
    ], (i, v) => {
      c.contents = (c.contents + i | 0) + v | 0;
    }), c.contents === 6));
  });
  let id = (loc, x) => {
    let u = x.slice(0);
    Test_utils.eq("File \"bs_array_test.res\", line 297, characters 6-13", Belt_Array.reverse(x), (Belt_Array.reverseInPlace(u), u));
  };
  Mocha.test("bs_array_test_id_functions", () => {
    id("File \"bs_array_test.res\", line 307, characters 7-14", []);
    id("File \"bs_array_test.res\", line 308, characters 7-14", [1]);
    id("File \"bs_array_test.res\", line 309, characters 7-14", [
      1,
      2
    ]);
    id("File \"bs_array_test.res\", line 310, characters 7-14", [
      1,
      2,
      3
    ]);
    id("File \"bs_array_test.res\", line 311, characters 7-14", [
      1,
      2,
      3,
      4
    ]);
  });
  Mocha.test("bs_array_test_every2_some2", () => {
    let every2 = (xs, ys, x) => Belt_Array.every2(Belt_List.toArray(xs), Belt_List.toArray(ys), x);
    let some2 = (xs, ys, x) => Belt_Array.some2(Belt_List.toArray(xs), Belt_List.toArray(ys), x);
    Test_utils.eq("File \"bs_array_test.res\", line 319, characters 7-14", every2(/* [] */0, {
      hd: 1,
      tl: /* [] */0
    }, (x, y) => x > y), true);
    Test_utils.eq("File \"bs_array_test.res\", line 320, characters 7-14", every2({
      hd: 2,
      tl: {
        hd: 3,
        tl: /* [] */0
      }
    }, {
      hd: 1,
      tl: /* [] */0
    }, (x, y) => x > y), true);
    Test_utils.eq("File \"bs_array_test.res\", line 321, characters 7-14", every2({
      hd: 2,
      tl: /* [] */0
    }, {
      hd: 1,
      tl: /* [] */0
    }, (x, y) => x > y), true);
    Test_utils.eq("File \"bs_array_test.res\", line 322, characters 7-14", every2({
      hd: 2,
      tl: {
        hd: 3,
        tl: /* [] */0
      }
    }, {
      hd: 1,
      tl: {
        hd: 4,
        tl: /* [] */0
      }
    }, (x, y) => x > y), false);
    Test_utils.eq("File \"bs_array_test.res\", line 323, characters 7-14", every2({
      hd: 2,
      tl: {
        hd: 3,
        tl: /* [] */0
      }
    }, {
      hd: 1,
      tl: {
        hd: 0,
        tl: /* [] */0
      }
    }, (x, y) => x > y), true);
    Test_utils.eq("File \"bs_array_test.res\", line 324, characters 7-14", some2(/* [] */0, {
      hd: 1,
      tl: /* [] */0
    }, (x, y) => x > y), false);
    Test_utils.eq("File \"bs_array_test.res\", line 325, characters 7-14", some2({
      hd: 2,
      tl: {
        hd: 3,
        tl: /* [] */0
      }
    }, {
      hd: 1,
      tl: /* [] */0
    }, (x, y) => x > y), true);
    Test_utils.eq("File \"bs_array_test.res\", line 326, characters 7-14", some2({
      hd: 2,
      tl: {
        hd: 3,
        tl: /* [] */0
      }
    }, {
      hd: 1,
      tl: {
        hd: 4,
        tl: /* [] */0
      }
    }, (x, y) => x > y), true);
    Test_utils.eq("File \"bs_array_test.res\", line 327, characters 7-14", some2({
      hd: 0,
      tl: {
        hd: 3,
        tl: /* [] */0
      }
    }, {
      hd: 1,
      tl: {
        hd: 4,
        tl: /* [] */0
      }
    }, (x, y) => x > y), false);
    Test_utils.eq("File \"bs_array_test.res\", line 328, characters 7-14", some2({
      hd: 0,
      tl: {
        hd: 3,
        tl: /* [] */0
      }
    }, {
      hd: 3,
      tl: {
        hd: 2,
        tl: /* [] */0
      }
    }, (x, y) => x > y), true);
  });
  Mocha.test("bs_array_test_concat_functions", () => {
    Test_utils.eq("File \"bs_array_test.res\", line 332, characters 7-14", Belt_Array.concat([], [
      1,
      2,
      3
    ]), [
      1,
      2,
      3
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 333, characters 7-14", Belt_Array.concat([], []), []);
    Test_utils.eq("File \"bs_array_test.res\", line 334, characters 7-14", Belt_Array.concat([
      3,
      2
    ], [
      1,
      2,
      3
    ]), [
      3,
      2,
      1,
      2,
      3
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 335, characters 7-14", Belt_Array.concatMany([
      [
        3,
        2
      ],
      [
        1,
        2,
        3
      ]
    ]), [
      3,
      2,
      1,
      2,
      3
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 336, characters 7-14", Belt_Array.concatMany([
      [
        3,
        2
      ],
      [
        1,
        2,
        3
      ],
      [],
      [0]
    ]), [
      3,
      2,
      1,
      2,
      3,
      0
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 337, characters 7-14", Belt_Array.concatMany([
      [],
      [
        3,
        2
      ],
      [
        1,
        2,
        3
      ],
      [],
      [0]
    ]), [
      3,
      2,
      1,
      2,
      3,
      0
    ]);
    Test_utils.eq("File \"bs_array_test.res\", line 338, characters 7-14", Belt_Array.concatMany([
      [],
      []
    ]), []);
  });
  Mocha.test("bs_array_test_cmp_functions", () => {
    Test_utils.ok("File \"bs_array_test.res\", line 342, characters 7-14", Belt_Array.cmp([
      1,
      2,
      3
    ], [
      0,
      1,
      2,
      3
    ], Primitive_int.compare) < 0);
    Test_utils.ok("File \"bs_array_test.res\", line 343, characters 7-14", Belt_Array.cmp([
      0,
      1,
      2,
      3
    ], [
      1,
      2,
      3
    ], Primitive_int.compare) > 0);
    Test_utils.ok("File \"bs_array_test.res\", line 344, characters 7-14", Belt_Array.cmp([
      1,
      2,
      3
    ], [
      0,
      1,
      2
    ], Primitive_int.compare) > 0);
    Test_utils.ok("File \"bs_array_test.res\", line 345, characters 7-14", Belt_Array.cmp([
      1,
      2,
      3
    ], [
      1,
      2,
      3
    ], Primitive_int.compare) === 0);
    Test_utils.ok("File \"bs_array_test.res\", line 346, characters 7-14", Belt_Array.cmp([
      1,
      2,
      4
    ], [
      1,
      2,
      3
    ], Primitive_int.compare) > 0);
  });
  Mocha.test("bs_array_test_getBy_functions", () => {
    Test_utils.eq("File \"bs_array_test.res\", line 350, characters 7-14", Belt_Array.getBy([
      1,
      2,
      3
    ], x => x > 1), 2);
    Test_utils.eq("File \"bs_array_test.res\", line 351, characters 7-14", Belt_Array.getBy([
      1,
      2,
      3
    ], x => x > 3), undefined);
  });
  Mocha.test("bs_array_test_getIndexBy_functions", () => {
    Test_utils.eq("File \"bs_array_test.res\", line 355, characters 7-14", Belt_Array.getIndexBy([
      1,
      2,
      3
    ], x => x > 1), 1);
    Test_utils.eq("File \"bs_array_test.res\", line 356, characters 7-14", Belt_Array.getIndexBy([
      1,
      2,
      3
    ], x => x > 3), undefined);
  });
  Mocha.test("bs_array_test_push_functions", () => {
    let arr = [];
    arr.push(3);
    arr.push(2);
    arr.push(1);
    Test_utils.eq("File \"bs_array_test.res\", line 364, characters 7-14", arr, [
      3,
      2,
      1
    ]);
  });
});

let A;

let L;

export {
  A,
  L,
  push,
}
/*  Not a pure module */
