1 module ut.ctfe.functions; 2 3 4 import ut.ctfe; 5 6 7 @ShouldFail("Not caught up with meta implemenation wrt overloads yet") 8 @("functions") 9 @safe pure unittest { 10 import std.traits: PSC = ParameterStorageClass; 11 12 enum mod = module_!("modules.functions"); 13 mod.functions[].shouldBeSameSetAs( 14 [ 15 Function( 16 "add1", 17 Type("int"), 18 [ 19 Parameter("int", "i"), 20 Parameter("int", "j"), 21 ], 22 ), 23 Function( 24 "add1", 25 Type("double"), 26 [ 27 Parameter("double", "d0"), 28 Parameter("double", "d1"), 29 ], 30 ), 31 Function( 32 "withDefault", 33 Type("double"), 34 [ 35 Parameter("double", "d0"), 36 Parameter("double", "d1", "33.3"), 37 ], 38 ), 39 Function( 40 "storageClasses", 41 Type("void"), 42 [ 43 Parameter("int", "normal", "", PSC.none), 44 Parameter("int*", "returnScope", "", PSC.return_ | PSC.scope_), 45 Parameter("int", "out_", "", PSC.out_), 46 Parameter("int", "ref_", "", PSC.ref_), 47 Parameter("int", "lazy_", "", PSC.lazy_), 48 ] 49 ), 50 Function( 51 "exportedFunc", 52 Type("void"), 53 [], 54 ), 55 Function( 56 "externC", 57 Type("void"), 58 [], 59 ), 60 Function( 61 "externCpp", 62 Type("void"), 63 [], 64 ), 65 Function( 66 "identityInt", 67 Type("int"), 68 [Parameter("int", "x", "", PSC.none)], 69 ), 70 ] 71 ); 72 }