From 0f70411cbf6548febfc0f664db72a246a92d4225 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 17 Mar 2024 22:08:05 -0400 Subject: Fix doctests with functions --- compile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compile.c b/compile.c index 94b7ec30..e1537c7d 100644 --- a/compile.c +++ b/compile.c @@ -229,10 +229,11 @@ CORD compile_statement(env_t *env, ast_t *ast) (int64_t)(test->expr->end - test->expr->file->text)); } else { return CORD_asprintf( - "{ // Test:\n%r $expr = %r;\n" + "{ // Test:\n" + "%r = %r;\n" "$test(&$expr, %r, %r, %r, %ld, %ld);\n" "}", - compile_type(env, expr_t), + compile_declaration(env, expr_t, "$expr"), compile(env, test->expr), compile_type_info(env, expr_t), compile(env, WrapAST(test->expr, TextLiteral, .cord=output)), -- cgit v1.2.3