From 9673d40bb91718252a012ce2250c0b8f3f993225 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 20 Nov 2020 16:57:44 +0200 Subject: [PATCH] ci: fix failing windows test run_v_code_from_stdin_test.v (2) --- vlib/v/tests/run_v_code_from_stdin_test.v | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vlib/v/tests/run_v_code_from_stdin_test.v b/vlib/v/tests/run_v_code_from_stdin_test.v index a45ed6ce80..171dc232a0 100644 --- a/vlib/v/tests/run_v_code_from_stdin_test.v +++ b/vlib/v/tests/run_v_code_from_stdin_test.v @@ -9,15 +9,16 @@ fn test_vexe_is_set() { } fn pipe_to_v_run() ? { - cat_cmd := if os.user_os() == 'windows' { 'type' } else { 'cat' } - tmp_v_file := os.join_path(os.temp_dir(), 'generated_piped_program.v') + cat_cmd := if os.user_os() == 'windows' { 'cmd /c type' } else { 'cat' } + tmp_v_file := os.join_path(os.real_path(os.temp_dir()), 'generated_piped_program.v') + // eprintln('>>> tmp_v_file: $tmp_v_file') os.write_file(tmp_v_file, 'println(1 + 3)\nprintln("hello")\n') ? assert os.is_file(tmp_v_file) cmd := '$cat_cmd "$tmp_v_file" | "$vexe" run -' res := os.exec(cmd) ? // eprintln('>> cmd: $cmd | res: $res') assert res.exit_code == 0 - assert res.output.trim_space().split('\n') == ['4', 'hello'] + assert res.output.replace('\r', '').trim_space().split('\n') == ['4', 'hello'] os.rm(tmp_v_file) assert !os.exists(tmp_v_file) }