From 71a92eb87bed7588906296ca570d89827e83706a Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 3 May 2020 22:25:38 +0300 Subject: [PATCH] tests: fix CI failing for builtin __as_cast --- vlib/v/gen/fn.v | 7 +++++-- vlib/v/tests/inout/compiler_test.v | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/vlib/v/gen/fn.v b/vlib/v/gen/fn.v index 23af82c276..d579968a33 100644 --- a/vlib/v/gen/fn.v +++ b/vlib/v/gen/fn.v @@ -479,11 +479,14 @@ fn (mut g Gen) fn_call(node ast.CallExpr) { } g.write('))') } - } else if g.pref.is_debug && node.name == 'panic' { + } else if g.pref.is_debug && node.name == 'panic' && g.fn_decl.name != '__as_cast' { paline := node.pos.line_nr + 1 pafile := g.fn_decl.file pafn := g.fn_decl.name.after('.') - pamod := g.fn_decl.name.all_before_last('.') + mut pamod := g.fn_decl.name.all_before_last('.') + if pamod == pafn { + pamod == 'builtin' + } g.write('panic_debug($paline, tos3("$pafile"), tos3("$pamod"), tos3("$pafn"), ') g.call_args(node.args, node.expected_arg_types) g.write(')') diff --git a/vlib/v/tests/inout/compiler_test.v b/vlib/v/tests/inout/compiler_test.v index 00d80dcea2..7434e9472b 100644 --- a/vlib/v/tests/inout/compiler_test.v +++ b/vlib/v/tests/inout/compiler_test.v @@ -15,7 +15,7 @@ fn test_all() { } for test in tests { path := os.join_path(dir, test).replace('\\', '/') - print(test + ' ') + print(path + ' ') program := path.replace('.vv', '.v') os.cp(path, program) or { panic(err)