aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/ocaml/overload_numeric_runme.ml
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/ocaml/overload_numeric_runme.ml')
-rw-r--r--Examples/test-suite/ocaml/overload_numeric_runme.ml14
1 files changed, 14 insertions, 0 deletions
diff --git a/Examples/test-suite/ocaml/overload_numeric_runme.ml b/Examples/test-suite/ocaml/overload_numeric_runme.ml
new file mode 100644
index 000000000..0342d63e0
--- /dev/null
+++ b/Examples/test-suite/ocaml/overload_numeric_runme.ml
@@ -0,0 +1,14 @@
+open Swig
+open Overload_numeric
+
+let _ =
+ let n = new_Nums '() in
+ let arg = C_char 'c' in
+ assert (n -> over (arg) as string = "signed char");
+ let arg = C_short 2 in
+ assert (n -> over (arg) as string = "short");
+ assert (n -> over (2) as string = "int");
+ let arg = C_float 2. in
+ assert (n -> over (arg) as string = "float");
+ assert (n -> over (2.) as string = "double")
+;;