From: fennecdjay Date: Fri, 20 Sep 2019 22:55:42 +0000 (+0200) Subject: :white_check_mark: Add tests X-Git-Tag: nightly~2215^2~8 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=a1e397e28f18ace43ed7d401dc556bbddec968f3;p=gwion.git :white_check_mark: Add tests --- diff --git a/tests/internal_op/conditionnal.gw b/tests/internal_op/conditionnal.gw new file mode 100644 index 00000000..acbd9dc2 --- /dev/null +++ b/tests/internal_op/conditionnal.gw @@ -0,0 +1,11 @@ +#! [contains] 1 +class C { 10 => int i; } + +operator @conditionnal int(C c) { + <<< __func__ >>>; + --c.i; + return c.i; +} + +C c; +while(c) <<>>; diff --git a/tests/internal_op/implicit.gw b/tests/internal_op/implicit.gw new file mode 100644 index 00000000..dc7f42f0 --- /dev/null +++ b/tests/internal_op/implicit.gw @@ -0,0 +1,12 @@ +#! [contains] 12 +class C { + 12 => int i; +} + +operator @implicit int (C c) { + return c.i; +} + +fun void test(int i) { <<< i >>>; } +C c; +c => test; diff --git a/tests/internal_op/unconditionnal.gw b/tests/internal_op/unconditionnal.gw new file mode 100644 index 00000000..623a1d0c --- /dev/null +++ b/tests/internal_op/unconditionnal.gw @@ -0,0 +1,11 @@ +#! [contains] 1 +class C { 10 => int i; } + +operator @unconditionnal int(C c) { + <<< __func__ >>>; + --c.i; + return !c.i; +} + +C c; +until(c) <<>>;