// Generated by ReScript, PLEASE EDIT WITH CARE

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

function makeWrapper(foo, param) {
  let tmp = {};
  if (foo !== undefined) {
    tmp.foo = Primitive_option.valFromOption(foo);
  }
  console.log(tmp);
}

function makeWrapper2(foo, param) {
  console.log({
    foo: foo
  });
}

makeWrapper2("a", undefined);

function makeWrapper3(foo, param) {
  console.log(2);
  let tmp = {};
  if (foo !== undefined) {
    tmp.foo = Primitive_option.valFromOption(foo);
  }
  return tmp;
}

function makeWrapper4(foo, param) {
  console.log(2);
  let tmp = {};
  let tmp$1 = foo > 100 ? undefined : (
      foo > 10 ? "b" : "a"
    );
  if (tmp$1 !== undefined) {
    tmp.foo = Primitive_option.valFromOption(tmp$1);
  }
  return tmp;
}

Mocha.describe("Gpr_2503_test", () => {
  Mocha.test("gpr_2503 polymorphic variant optional parameter test", () => {
    Test_utils.ok("File \"gpr_2503_test.res\", line 39, characters 7-14", "a" === makeWrapper3("a", undefined).foo);
    Test_utils.ok("File \"gpr_2503_test.res\", line 40, characters 7-14", undefined === makeWrapper3(undefined, undefined).foo);
    Test_utils.ok("File \"gpr_2503_test.res\", line 41, characters 7-14", "a" === makeWrapper4(1, undefined).foo);
    Test_utils.ok("File \"gpr_2503_test.res\", line 42, characters 7-14", "b" === makeWrapper4(11, undefined).foo);
    Test_utils.ok("File \"gpr_2503_test.res\", line 43, characters 7-14", undefined === makeWrapper4(111, undefined).foo);
  });
});

export {
  makeWrapper,
  makeWrapper2,
  makeWrapper3,
  makeWrapper4,
}
/*  Not a pure module */
