swig/Examples/test-suite/ocaml/overload_bool_runme.ml
Zackery Spytz b879ccdc3e [OCaml] Fix the handling of bools in overloaded functions
Use the SWIG_TYPECHECK_BOOL precedence level instead of
SWIG_TYPECHECK_INTEGER when checking for bools.

Add a runtime test in the form of overload_bool_runme.ml.
2019-01-18 23:42:59 -07:00

15 lines
551 B
OCaml

open Swig
open Overload_bool
let _ =
assert (_overloaded '(true) as string = "bool");
assert (_overloaded '(false) as string = "bool");
assert (_overloaded '(0) as string = "int");
assert (_overloaded '(1) as string = "int");
assert (_overloaded '(2) as string = "int");
assert (_overloaded '("1234") as string = "string");
assert (_boolfunction '(true) as string = "true");
assert (_boolfunction '(false) as string = "false");
assert (_intfunction '(true) as string = "int");
assert (_intfunction '(false) as string = "int");
;;