From: fennecdjay Date: Fri, 16 Aug 2019 10:41:39 +0000 (+0200) Subject: :art: More type algebra and tests X-Git-Tag: nightly~2277 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=9dff28ed8c7a842665bc3cbf07356c2188f0de4b;p=gwion.git :art: More type algebra and tests --- diff --git a/src/lib/engine.c b/src/lib/engine.c index 4c13145e..4b128d24 100644 --- a/src/lib/engine.c +++ b/src/lib/engine.c @@ -106,6 +106,7 @@ ANN static m_bool import_core_libs(const Gwi gwi) { GWI_BB(gwi_oper_ini(gwi, "Class", "Class", "int")) GWI_BB(gwi_oper_end(gwi, "==", int_eq)) + GWI_BB(gwi_oper_end(gwi, "!=", int_neq)) GWI_BB(gwi_oper_end(gwi, ">=", instr_class_ge)) GWI_BB(gwi_oper_end(gwi, ">", instr_class_gt)) GWI_BB(gwi_oper_end(gwi, "<=", instr_class_le)) diff --git a/tests/new/typeof.gw b/tests/new/typeof.gw new file mode 100644 index 00000000..44e41d89 --- /dev/null +++ b/tests/new/typeof.gw @@ -0,0 +1,8 @@ +<<< typeof(1) == typeof(2) >>>; +<<< typeof(1) != typeof(2) >>>; +<<< typeof(1) > typeof(2) >>>; +<<< typeof(1) >= typeof(2) >>>; +<<< typeof(1) < typeof(2) >>>; +<<< typeof(1) <= typeof(2) >>>; +<<< typeof(1) == Object >>>; +<<< typeof(1) > Object >>>; diff --git a/tests/new/typeof2.gw b/tests/new/typeof2.gw new file mode 100644 index 00000000..1e9bd9aa --- /dev/null +++ b/tests/new/typeof2.gw @@ -0,0 +1,2 @@ +<<< int >>>; +<<< typeof(1) >= int >>>; diff --git a/tests/new/typeof3.gw b/tests/new/typeof3.gw new file mode 100644 index 00000000..9039e933 --- /dev/null +++ b/tests/new/typeof3.gw @@ -0,0 +1,9 @@ +class C {} +class D extends C {} +C c; +D d; +<<< typeof(c) < typeof(d) >>>; +<<< typeof(c) > typeof(d) >>>; +<<< C < D >>>; +<<< C > D >>>; +