1open Swig 2open Extend_placement 3 4let _ = 5 let f = new_Foo '() in 6 assert (f -> spam () as int = 1); 7 assert (new_Foo '(1) -> spam () as int = 1); 8 let f = new_Foo '(1, 1) in 9 assert (f -> spam () as int = 1); 10 assert (f -> spam ("hello") as int = 2); 11 assert (f -> spam (1) as int = 1); 12 assert (f -> spam (1, 2) as int = 3); 13 assert (f -> spam (2, 4, 6) as int = 6); 14 assert (f -> spam (f) as int = 0); 15 let arg = C_double 1. in 16 assert (f -> spam (f, arg) as int = 0); 17 18 assert (new_Bar '() -> spam () as int = 1); 19 let b = new_Bar '(1) in 20 assert (b -> spam () as int = 1); 21 assert (b -> spam ("hello") as int = 2); 22 assert (b -> spam (1) as int = 1); 23 assert (b -> spam (1, 2) as int = 3); 24 assert (b -> spam (2, 4, 6) as int = 6); 25 assert (b -> spam (b) as int = 0); 26 let arg = C_double 1. in 27 assert (b -> spam (b, arg) as int = 0); 28 29 assert (new_FooTi '() -> spam () as int = 1); 30 assert (new_FooTi '(1) -> spam () as int = 1); 31 let f = new_FooTi '(1, 1) in 32 assert (f -> spam () as int = 1); 33 assert (f -> spam ("hello") as int = 2); 34 assert (f -> spam (1) as int = 1); 35 assert (f -> spam (1, 2) as int = 3); 36 assert (f -> spam (2, 4, 6) as int = 6); 37 let foo = new_Foo '() in 38 assert (f -> spam (foo) as int = 0); 39 let arg = C_double 1. in 40 assert (f -> spam (foo, arg) as int = 0); 41 42 assert (new_BarTi '() -> spam () as int = 1); 43 let b = new_BarTi '(1) in 44 assert (b -> spam () as int = 1); 45 assert (b -> spam ("hello") as int = 2); 46 assert (b -> spam (1) as int = 1); 47 assert (b -> spam (1, 2) as int = 3); 48 assert (b -> spam (2, 4, 6) as int = 6); 49 let bar = new_Bar '() in 50 assert (b -> spam (bar) as int = 0); 51 let arg = C_double 1. in 52 assert (b -> spam (bar, arg) as int = 0); 53;; 54