// Generated by ReScript, PLEASE EDIT WITH CARE

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

function does_raise(f, q) {
  try {
    f(q);
    return false;
  } catch (exn) {
    return true;
  }
}

function queueAdd(q, x) {
  Belt_MutableQueue.add(q, x);
  return q;
}

Mocha.describe("Bs_queue_test", () => {
  Mocha.test("basic queue operations", () => {
    let q = Belt_MutableQueue.make();
    if (!(Primitive_object.equal(Belt_MutableQueue.toArray(q), []) && Belt_MutableQueue.size(q) === 0)) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          21,
          4
        ],
        Error: new Error()
      };
    }
    if (!(Primitive_object.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 1), q)), [1]) && Belt_MutableQueue.size(q) === 1)) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          22,
          4
        ],
        Error: new Error()
      };
    }
    if (!(Primitive_object.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 2), q)), [
        1,
        2
      ]) && Belt_MutableQueue.size(q) === 2)) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          23,
          4
        ],
        Error: new Error()
      };
    }
    if (!(Primitive_object.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 3), q)), [
        1,
        2,
        3
      ]) && Belt_MutableQueue.size(q) === 3)) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          24,
          4
        ],
        Error: new Error()
      };
    }
    if (!(Primitive_object.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 4), q)), [
        1,
        2,
        3,
        4
      ]) && Belt_MutableQueue.size(q) === 4)) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          25,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.popExn(q) !== 1) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          26,
          4
        ],
        Error: new Error()
      };
    }
    if (!(Primitive_object.equal(Belt_MutableQueue.toArray(q), [
        2,
        3,
        4
      ]) && Belt_MutableQueue.size(q) === 3)) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          27,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.popExn(q) !== 2) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          28,
          4
        ],
        Error: new Error()
      };
    }
    if (!(Primitive_object.equal(Belt_MutableQueue.toArray(q), [
        3,
        4
      ]) && Belt_MutableQueue.size(q) === 2)) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          29,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.popExn(q) !== 3) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          30,
          4
        ],
        Error: new Error()
      };
    }
    if (!(Primitive_object.equal(Belt_MutableQueue.toArray(q), [4]) && Belt_MutableQueue.size(q) === 1)) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          31,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.popExn(q) !== 4) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          32,
          4
        ],
        Error: new Error()
      };
    }
    if (!(Primitive_object.equal(Belt_MutableQueue.toArray(q), []) && Belt_MutableQueue.size(q) === 0)) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          33,
          4
        ],
        Error: new Error()
      };
    }
    if (does_raise(Belt_MutableQueue.popExn, q)) {
      return;
    }
    throw {
      RE_EXN_ID: "Assert_failure",
      _1: [
        "bs_queue_test.res",
        34,
        4
      ],
      Error: new Error()
    };
  });
  Mocha.test("queue pop operations", () => {
    let q = Belt_MutableQueue.make();
    if (Belt_MutableQueue.popExn((Belt_MutableQueue.add(q, 1), q)) !== 1) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          39,
          4
        ],
        Error: new Error()
      };
    }
    if (!does_raise(Belt_MutableQueue.popExn, q)) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          40,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.popExn((Belt_MutableQueue.add(q, 2), q)) !== 2) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          41,
          4
        ],
        Error: new Error()
      };
    }
    if (!does_raise(Belt_MutableQueue.popExn, q)) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          42,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.size(q) === 0) {
      return;
    }
    throw {
      RE_EXN_ID: "Assert_failure",
      _1: [
        "bs_queue_test.res",
        43,
        4
      ],
      Error: new Error()
    };
  });
  Mocha.test("queue peek operations", () => {
    let q = Belt_MutableQueue.make();
    if (Belt_MutableQueue.peekExn((Belt_MutableQueue.add(q, 1), q)) !== 1) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          48,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.peekExn((Belt_MutableQueue.add(q, 2), q)) !== 1) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          49,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.peekExn((Belt_MutableQueue.add(q, 3), q)) !== 1) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          50,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.peekExn(q) !== 1) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          51,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.popExn(q) !== 1) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          52,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.peekExn(q) !== 2) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          53,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.popExn(q) !== 2) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          54,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.peekExn(q) !== 3) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          55,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.popExn(q) !== 3) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          56,
          4
        ],
        Error: new Error()
      };
    }
    if (!does_raise(Belt_MutableQueue.peekExn, q)) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          57,
          4
        ],
        Error: new Error()
      };
    }
    if (does_raise(Belt_MutableQueue.peekExn, q)) {
      return;
    }
    throw {
      RE_EXN_ID: "Assert_failure",
      _1: [
        "bs_queue_test.res",
        58,
        4
      ],
      Error: new Error()
    };
  });
  Mocha.test("queue clear operations", () => {
    let q = Belt_MutableQueue.make();
    for (let i = 1; i <= 10; ++i) {
      Belt_MutableQueue.add(q, i);
    }
    Belt_MutableQueue.clear(q);
    if (Belt_MutableQueue.size(q) !== 0) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          67,
          4
        ],
        Error: new Error()
      };
    }
    if (!does_raise(Belt_MutableQueue.popExn, q)) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          68,
          4
        ],
        Error: new Error()
      };
    }
    if (!Primitive_object.equal(q, Belt_MutableQueue.make())) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          69,
          4
        ],
        Error: new Error()
      };
    }
    Belt_MutableQueue.add(q, 42);
    if (Belt_MutableQueue.popExn(q) === 42) {
      return;
    }
    throw {
      RE_EXN_ID: "Assert_failure",
      _1: [
        "bs_queue_test.res",
        71,
        4
      ],
      Error: new Error()
    };
  });
  Mocha.test("queue copy operations", () => {
    let q1 = Belt_MutableQueue.make();
    for (let i = 1; i <= 10; ++i) {
      Belt_MutableQueue.add(q1, i);
    }
    let q2 = Belt_MutableQueue.copy(q1);
    if (!Primitive_object.equal(Belt_MutableQueue.toArray(q1), [
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10
      ])) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          80,
          4
        ],
        Error: new Error()
      };
    }
    if (!Primitive_object.equal(Belt_MutableQueue.toArray(q2), [
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10
      ])) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          81,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.size(q1) !== 10) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          82,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.size(q2) !== 10) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          83,
          4
        ],
        Error: new Error()
      };
    }
    for (let i$1 = 1; i$1 <= 10; ++i$1) {
      if (Belt_MutableQueue.popExn(q1) !== i$1) {
        throw {
          RE_EXN_ID: "Assert_failure",
          _1: [
            "bs_queue_test.res",
            85,
            6
          ],
          Error: new Error()
        };
      }
    }
    for (let i$2 = 1; i$2 <= 10; ++i$2) {
      if (Belt_MutableQueue.popExn(q2) !== i$2) {
        throw {
          RE_EXN_ID: "Assert_failure",
          _1: [
            "bs_queue_test.res",
            88,
            6
          ],
          Error: new Error()
        };
      }
    }
  });
  Mocha.test("queue size and isEmpty operations", () => {
    let q = Belt_MutableQueue.make();
    if (!Belt_MutableQueue.isEmpty(q)) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          94,
          4
        ],
        Error: new Error()
      };
    }
    for (let i = 1; i <= 10; ++i) {
      Belt_MutableQueue.add(q, i);
      if (Belt_MutableQueue.size(q) !== i) {
        throw {
          RE_EXN_ID: "Assert_failure",
          _1: [
            "bs_queue_test.res",
            97,
            6
          ],
          Error: new Error()
        };
      }
      if (Belt_MutableQueue.isEmpty(q)) {
        throw {
          RE_EXN_ID: "Assert_failure",
          _1: [
            "bs_queue_test.res",
            98,
            6
          ],
          Error: new Error()
        };
      }
    }
    for (let i$1 = 10; i$1 >= 1; --i$1) {
      if (Belt_MutableQueue.size(q) !== i$1) {
        throw {
          RE_EXN_ID: "Assert_failure",
          _1: [
            "bs_queue_test.res",
            101,
            6
          ],
          Error: new Error()
        };
      }
      if (Belt_MutableQueue.isEmpty(q)) {
        throw {
          RE_EXN_ID: "Assert_failure",
          _1: [
            "bs_queue_test.res",
            102,
            6
          ],
          Error: new Error()
        };
      }
      Belt_MutableQueue.popExn(q);
    }
    if (Belt_MutableQueue.size(q) !== 0) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          105,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.isEmpty(q)) {
      return;
    }
    throw {
      RE_EXN_ID: "Assert_failure",
      _1: [
        "bs_queue_test.res",
        106,
        4
      ],
      Error: new Error()
    };
  });
  Mocha.test("queue forEach operations", () => {
    let q = Belt_MutableQueue.make();
    for (let i = 1; i <= 10; ++i) {
      Belt_MutableQueue.add(q, i);
    }
    let i$1 = {
      contents: 1
    };
    Belt_MutableQueue.forEach(q, j => {
      if (i$1.contents !== j) {
        throw {
          RE_EXN_ID: "Assert_failure",
          _1: [
            "bs_queue_test.res",
            118,
            8
          ],
          Error: new Error()
        };
      }
      i$1.contents = i$1.contents + 1 | 0;
    });
  });
  Mocha.test("queue transfer operations - empty to empty", () => {
    let q1 = Belt_MutableQueue.make();
    let q2 = Belt_MutableQueue.make();
    if (Belt_MutableQueue.size(q1) !== 0) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          126,
          4
        ],
        Error: new Error()
      };
    }
    if (!Primitive_object.equal(Belt_MutableQueue.toArray(q1), [])) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          127,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.size(q2) !== 0) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          128,
          4
        ],
        Error: new Error()
      };
    }
    if (!Primitive_object.equal(Belt_MutableQueue.toArray(q2), [])) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          129,
          4
        ],
        Error: new Error()
      };
    }
    Belt_MutableQueue.transfer(q1, q2);
    if (Belt_MutableQueue.size(q1) !== 0) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          131,
          4
        ],
        Error: new Error()
      };
    }
    if (!Primitive_object.equal(Belt_MutableQueue.toArray(q1), [])) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          132,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.size(q2) !== 0) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          133,
          4
        ],
        Error: new Error()
      };
    }
    if (Primitive_object.equal(Belt_MutableQueue.toArray(q2), [])) {
      return;
    }
    throw {
      RE_EXN_ID: "Assert_failure",
      _1: [
        "bs_queue_test.res",
        134,
        4
      ],
      Error: new Error()
    };
  });
  Mocha.test("queue transfer operations - source to empty", () => {
    let q1 = Belt_MutableQueue.make();
    let q2 = Belt_MutableQueue.make();
    for (let i = 1; i <= 4; ++i) {
      Belt_MutableQueue.add(q1, i);
    }
    if (Belt_MutableQueue.size(q1) !== 4) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          142,
          4
        ],
        Error: new Error()
      };
    }
    if (!Primitive_object.equal(Belt_MutableQueue.toArray(q1), [
        1,
        2,
        3,
        4
      ])) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          143,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.size(q2) !== 0) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          144,
          4
        ],
        Error: new Error()
      };
    }
    if (!Primitive_object.equal(Belt_MutableQueue.toArray(q2), [])) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          145,
          4
        ],
        Error: new Error()
      };
    }
    Belt_MutableQueue.transfer(q1, q2);
    if (Belt_MutableQueue.size(q1) !== 0) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          147,
          4
        ],
        Error: new Error()
      };
    }
    if (!Primitive_object.equal(Belt_MutableQueue.toArray(q1), [])) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          148,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.size(q2) !== 4) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          149,
          4
        ],
        Error: new Error()
      };
    }
    if (Primitive_object.equal(Belt_MutableQueue.toArray(q2), [
        1,
        2,
        3,
        4
      ])) {
      return;
    }
    throw {
      RE_EXN_ID: "Assert_failure",
      _1: [
        "bs_queue_test.res",
        150,
        4
      ],
      Error: new Error()
    };
  });
  Mocha.test("queue transfer operations - empty to source", () => {
    let q1 = Belt_MutableQueue.make();
    let q2 = Belt_MutableQueue.make();
    for (let i = 5; i <= 8; ++i) {
      Belt_MutableQueue.add(q2, i);
    }
    if (Belt_MutableQueue.size(q1) !== 0) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          158,
          4
        ],
        Error: new Error()
      };
    }
    if (!Primitive_object.equal(Belt_MutableQueue.toArray(q1), [])) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          159,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.size(q2) !== 4) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          160,
          4
        ],
        Error: new Error()
      };
    }
    if (!Primitive_object.equal(Belt_MutableQueue.toArray(q2), [
        5,
        6,
        7,
        8
      ])) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          161,
          4
        ],
        Error: new Error()
      };
    }
    Belt_MutableQueue.transfer(q1, q2);
    if (Belt_MutableQueue.size(q1) !== 0) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          163,
          4
        ],
        Error: new Error()
      };
    }
    if (!Primitive_object.equal(Belt_MutableQueue.toArray(q1), [])) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          164,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.size(q2) !== 4) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          165,
          4
        ],
        Error: new Error()
      };
    }
    if (Primitive_object.equal(Belt_MutableQueue.toArray(q2), [
        5,
        6,
        7,
        8
      ])) {
      return;
    }
    throw {
      RE_EXN_ID: "Assert_failure",
      _1: [
        "bs_queue_test.res",
        166,
        4
      ],
      Error: new Error()
    };
  });
  Mocha.test("queue transfer operations - both queues have data", () => {
    let q1 = Belt_MutableQueue.make();
    let q2 = Belt_MutableQueue.make();
    for (let i = 1; i <= 4; ++i) {
      Belt_MutableQueue.add(q1, i);
    }
    for (let i$1 = 5; i$1 <= 8; ++i$1) {
      Belt_MutableQueue.add(q2, i$1);
    }
    if (Belt_MutableQueue.size(q1) !== 4) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          177,
          4
        ],
        Error: new Error()
      };
    }
    if (!Primitive_object.equal(Belt_MutableQueue.toArray(q1), [
        1,
        2,
        3,
        4
      ])) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          178,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.size(q2) !== 4) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          179,
          4
        ],
        Error: new Error()
      };
    }
    if (!Primitive_object.equal(Belt_MutableQueue.toArray(q2), [
        5,
        6,
        7,
        8
      ])) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          180,
          4
        ],
        Error: new Error()
      };
    }
    Belt_MutableQueue.transfer(q1, q2);
    if (Belt_MutableQueue.size(q1) !== 0) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          182,
          4
        ],
        Error: new Error()
      };
    }
    if (!Primitive_object.equal(Belt_MutableQueue.toArray(q1), [])) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          183,
          4
        ],
        Error: new Error()
      };
    }
    let v = [
      5,
      6,
      7,
      8,
      1,
      2,
      3,
      4
    ];
    if (Belt_MutableQueue.size(q2) !== 8) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          185,
          4
        ],
        Error: new Error()
      };
    }
    if (!Primitive_object.equal(Belt_MutableQueue.toArray(q2), v)) {
      throw {
        RE_EXN_ID: "Assert_failure",
        _1: [
          "bs_queue_test.res",
          186,
          4
        ],
        Error: new Error()
      };
    }
    if (Belt_MutableQueue.reduce(q2, 0, (x, y) => x - y | 0) === Belt_Array.reduce(v, 0, (x, y) => x - y | 0)) {
      return;
    }
    throw {
      RE_EXN_ID: "Assert_failure",
      _1: [
        "bs_queue_test.res",
        188,
        4
      ],
      Error: new Error()
    };
  });
  Mocha.test("queue map and fromArray operations", () => {
    let q = Belt_MutableQueue.fromArray([
      1,
      2,
      3,
      4
    ]);
    let q1 = Belt_MutableQueue.map(q, x => x - 1 | 0);
    Test_utils.eq("File \"bs_queue_test.res\", line 194, characters 7-14", Belt_MutableQueue.toArray(q1), [
      0,
      1,
      2,
      3
    ]);
    Test_utils.ok("File \"bs_queue_test.res\", line 195, characters 7-14", Belt_MutableQueue.isEmpty(Belt_MutableQueue.fromArray([])));
    Test_utils.ok("File \"bs_queue_test.res\", line 196, characters 7-14", Belt_MutableQueue.isEmpty(Belt_MutableQueue.map(Belt_MutableQueue.fromArray([]), x => x + 1 | 0)));
  });
});

let Q;

export {
  Q,
  does_raise,
  queueAdd,
}
/*  Not a pure module */
