From cdf70c070bf8c594299a59fb190d29dd5b3b9ee7 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Mon, 4 May 2020 14:32:25 +0300 Subject: [PATCH] tests: add panic_with_cg.vv/.out --- vlib/v/parser/fn.v | 1 + vlib/v/tests/inout/panic_with_cg.out | 6 ++++++ vlib/v/tests/inout/panic_with_cg.vv | 8 ++++++++ 3 files changed, 15 insertions(+) create mode 100644 vlib/v/tests/inout/panic_with_cg.out create mode 100644 vlib/v/tests/inout/panic_with_cg.vv diff --git a/vlib/v/parser/fn.v b/vlib/v/parser/fn.v index 294f94df47..e2fa7e7fbd 100644 --- a/vlib/v/parser/fn.v +++ b/vlib/v/parser/fn.v @@ -257,6 +257,7 @@ fn (mut p Parser) fn_decl() ast.FnDecl { no_body: no_body pos: start_pos.extend(end_pos) body_pos: body_start_pos + file: p.file_name is_builtin: p.builtin_mod || p.mod in util.builtin_module_parts ctdefine: ctdefine } diff --git a/vlib/v/tests/inout/panic_with_cg.out b/vlib/v/tests/inout/panic_with_cg.out new file mode 100644 index 0000000000..05bfa60ed4 --- /dev/null +++ b/vlib/v/tests/inout/panic_with_cg.out @@ -0,0 +1,6 @@ +================ V panic ================ + module: buggy_function + function: buggy_function() + message: panicing... + file: vlib/v/tests/inout/panic_with_cg.v + line: 3 diff --git a/vlib/v/tests/inout/panic_with_cg.vv b/vlib/v/tests/inout/panic_with_cg.vv new file mode 100644 index 0000000000..7e2fb4f913 --- /dev/null +++ b/vlib/v/tests/inout/panic_with_cg.vv @@ -0,0 +1,8 @@ + +fn buggy_function() { + panic('panicing...') +} + +fn main(){ + buggy_function() +}