From: fennecdjay Date: Fri, 11 Oct 2019 22:16:27 +0000 (+0200) Subject: :art: Still on import ... X-Git-Tag: nightly~2162 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=f06ff0b2d72489b938884b62d6075dbf7cb5601a;p=gwion.git :art: Still on import ... --- diff --git a/tests/import/class_template.c b/tests/import/class_template.c index 79d677c7..80329369 100644 --- a/tests/import/class_template.c +++ b/tests/import/class_template.c @@ -38,10 +38,6 @@ GWION_IMPORT(class_template) { GWI_BB((o_map_key = gwi_item_end(gwi, ae_flag_member | ae_flag_template, NULL))) GWI_BB(gwi_item_ini(gwi, "B[]", "value")) GWI_BB((o_map_value = gwi_item_end(gwi, ae_flag_member, NULL))) - - - /*gwi_func_ini(gwi, "B", "set", class_template_set);*/ - /*gwi_func_end(gwi, ae_flag_member);*/ GWI_BB(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/import/class_template_fail.c b/tests/import/class_template_fail.c new file mode 100644 index 00000000..2409024a --- /dev/null +++ b/tests/import/class_template_fail.c @@ -0,0 +1,28 @@ +#include "gwion_util.h" +#include "gwion_ast.h" +#include "oo.h" +#include "vm.h" +#include "env.h" +#include "type.h" +#include "object.h" +#include "instr.h" +#include "gwion.h" +#include "value.h" +#include "operator.h" +#include "import.h" +#include "gwi.h" + +GWION_IMPORT(class_template_fail) { + Type t_fail; + const m_str list[2] = { "A", "B" }; + gwi_tmpl_ini(gwi, 2, list); + GWI_OB((t_fail = gwi_mk_type(gwi, "ClassTemplate", SZ_INT, "Object"))) + GWI_BB(gwi_class_ini(gwi, t_fail, NULL, NULL)) + gwi_tmpl_end(gwi); + gwi_tmpl_ini(gwi, 2, list); + GWI_BB(gwi_func_ini(gwi, "int", "test", (f_xfun)1)) + GWI_BB(gwi_func_end(gwi, ae_flag_none)) + gwi_tmpl_end(gwi); + GWI_BB(gwi_class_end(gwi)) + return GW_OK; +} diff --git a/tests/import/func_fail.c b/tests/import/func_fail.c new file mode 100644 index 00000000..8227bff3 --- /dev/null +++ b/tests/import/func_fail.c @@ -0,0 +1,20 @@ +#include "gwion_util.h" +#include "gwion_ast.h" +#include "oo.h" +#include "vm.h" +#include "env.h" +#include "type.h" +#include "instr.h" +#include "object.h" +#include "gwion.h" +#include "value.h" +#include "operator.h" +#include "import.h" +#include "instr.h" + +GWION_IMPORT(too_many_args) { + GWI_BB(gwi_func_ini(gwi, "int", "test", (f_xfun)1)) + GWI_BB(gwi_func_arg(gwi, "Int", "i")) + GWI_BB(gwi_func_end(gwi, 0)) + return GW_OK; +} diff --git a/tests/sh/import.sh b/tests/sh/import.sh index aec12dfb..e493fc23 100644 --- a/tests/sh/import.sh +++ b/tests/sh/import.sh @@ -1,5 +1,5 @@ #!/bin/bash -# [test] #45 +# [test] #47 n=0 [ "$1" ] && n="$1"