From: Jérémie Astor Date: Tue, 26 Apr 2022 19:56:50 +0000 (+0200) Subject: :white_check_mark: Add testing X-Git-Tag: nightly~275^2~36 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=7f5add1c6c312e4bbbe863ca4bf3794a7184425c;p=gwion.git :white_check_mark: Add testing --- diff --git a/src/parse/partial.c b/src/parse/partial.c index a539c597..8a32be05 100644 --- a/src/parse/partial.c +++ b/src/parse/partial.c @@ -194,7 +194,7 @@ ANN static Exp expand(const Env env, const Func func, const Exp e, const loc_t l ANN Type partial_type(const Env env, Exp_Call *const call) { const Func base = call->func->type->info->func; - if(!base) ERR_O(call->func->pos, _("can't do partiall application on a literal lambda")); + if(!base) ERR_O(call->func->pos, _("can't do partial application on a literal lambda")); const Func f = partial_match(env, base, call->args, call->func->pos); if(!f) { const Exp e = expand(env, call->func->type->info->func, call->args, call->func->pos); diff --git a/tests/captures/lambda_captures.gw b/tests/captures/lambda_captures.gw new file mode 100644 index 00000000..2a8b3dd7 --- /dev/null +++ b/tests/captures/lambda_captures.gw @@ -0,0 +1,5 @@ +#! [contains] 42 +40 => var int a; +{ +\ : a : { <<< a + 2 >>>; }(); +} diff --git a/tests/captures/not_upvalue.gw b/tests/captures/not_upvalue.gw new file mode 100644 index 00000000..3074e01c --- /dev/null +++ b/tests/captures/not_upvalue.gw @@ -0,0 +1,3 @@ +#! [contains] can't take ref of a scoped value +foreach(a : [1,2]) + spork : &a :{ <<< "${a}" >>>; samp => now; <<< "${a}" >>>; }; diff --git a/tests/captures/spork_capture.gw b/tests/captures/spork_capture.gw new file mode 100644 index 00000000..ee0c7cc0 --- /dev/null +++ b/tests/captures/spork_capture.gw @@ -0,0 +1,4 @@ +#! [contains] 42 1 +foreach(a : [ 1, 2]) + spork : a : { <<< "42 ${a}" >>>; }; +samp => now; diff --git a/tests/lambdas/partial_lambda.gw b/tests/lambdas/partial_lambda.gw new file mode 100644 index 00000000..3dab18a8 --- /dev/null +++ b/tests/lambdas/partial_lambda.gw @@ -0,0 +1,2 @@ +#! [contains] can't do partial application on a literal lambda +<<< \a { }(_) >>>;