From 8a4313c1b8154764b5c7d9ed7df3cbc7d4787b93 Mon Sep 17 00:00:00 2001 From: Subhomoy Haldar Date: Tue, 12 Jul 2022 11:16:59 +0530 Subject: [PATCH] ci: fix vlib/v/builder/builder_test.v failures on msvc (#15035) --- vlib/v/builder/builder_test.v | 36 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/vlib/v/builder/builder_test.v b/vlib/v/builder/builder_test.v index 9961dbf63a..db97789caf 100644 --- a/vlib/v/builder/builder_test.v +++ b/vlib/v/builder/builder_test.v @@ -1,22 +1,9 @@ module main import os -import arrays const test_path = 'v_run_check' -fn arrays_are_equivalent(a []string, b []string) bool { - if a.len != b.len { - return false - } - for item in a { - if item !in b { - return false - } - } - return true -} - fn test_conditional_executable_removal() ? { // Setup the sample project dir := os.join_path(os.temp_dir(), test_path) @@ -36,20 +23,23 @@ fn test_conditional_executable_removal() ? { executable += '.exe' } - original_file_list := os.ls(dir)? - new_file_list := arrays.concat(original_file_list, executable) + original_file_list_ := os.ls(dir)? + dump(original_file_list_) + assert executable !in original_file_list_ assert os.execute('${os.quoted_path(@VEXE)} run .').output.trim_space() == 'Hello World!' + after_run_file_list := os.ls(dir)? + dump(after_run_file_list) + assert executable !in after_run_file_list - assert arrays_are_equivalent(os.ls(dir)?, original_file_list) - - assert os.execute('${os.quoted_path(@VEXE)} .').output == '' - + assert os.execute('${os.quoted_path(@VEXE)} .').exit_code == 0 assert os.execute('./$executable').output.trim_space() == 'Hello World!' - - assert arrays_are_equivalent(os.ls(dir)?, new_file_list) + after_compilation__ := os.ls(dir)? + dump(after_compilation__) + assert executable in after_compilation__ assert os.execute('${os.quoted_path(@VEXE)} run .').output.trim_space() == 'Hello World!' - - assert arrays_are_equivalent(os.ls(dir)?, new_file_list) + after_second_run___ := os.ls(dir)? + dump(after_second_run___) + assert executable in after_second_run___ }