From 1c2b4e76dc35a4047993cd1a123383f8c132438b Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sat, 29 Jul 2023 16:41:02 +0300 Subject: [PATCH] tests: fix diff.color_compare_strings parameter order in test files, to make analysing the results easier --- cmd/tools/vdoc/tests/vdoc_file_test.v | 2 +- cmd/tools/vvet/vet_test.v | 2 +- vlib/v/compiler_errors_test.v | 4 ++-- vlib/v/gen/js/program_test.v | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/tools/vdoc/tests/vdoc_file_test.v b/cmd/tools/vdoc/tests/vdoc_file_test.v index cee7d2bc1c..9ad62cc59b 100644 --- a/cmd/tools/vdoc/tests/vdoc_file_test.v +++ b/cmd/tools/vdoc/tests/vdoc_file_test.v @@ -71,7 +71,7 @@ fn print_compare(expected string, found string) { println(found) println('============\n') println('diff:') - println(diff.color_compare_strings(diff_cmd, rand.ulid(), found, expected)) + println(diff.color_compare_strings(diff_cmd, rand.ulid(), expected, found)) println('============\n') } diff --git a/cmd/tools/vvet/vet_test.v b/cmd/tools/vvet/vet_test.v index aab8f94a02..db05175a2a 100644 --- a/cmd/tools/vvet/vet_test.v +++ b/cmd/tools/vvet/vet_test.v @@ -52,7 +52,7 @@ fn check_path(vexe string, dir string, tests []string) int { println(found) println('============\n') println('diff:') - println(diff.color_compare_strings(diff_cmd, rand.ulid(), found, expected)) + println(diff.color_compare_strings(diff_cmd, rand.ulid(), expected, found)) println('============\n') nb_fail++ } else { diff --git a/vlib/v/compiler_errors_test.v b/vlib/v/compiler_errors_test.v index d088092ba4..5a251e4ff6 100644 --- a/vlib/v/compiler_errors_test.v +++ b/vlib/v/compiler_errors_test.v @@ -362,10 +362,10 @@ fn clean_line_endings(s string) string { return res } -fn diff_content(s1 string, s2 string) { +fn diff_content(expected string, found string) { diff_cmd := diff.find_working_diff_command() or { return } println(term.bold(term.yellow('diff: '))) - println(diff.color_compare_strings(diff_cmd, rand.ulid(), s1, s2)) + println(diff.color_compare_strings(diff_cmd, rand.ulid(), expected, found)) println('============\n') } diff --git a/vlib/v/gen/js/program_test.v b/vlib/v/gen/js/program_test.v index bf4c2f37a2..68dc0fe6b1 100644 --- a/vlib/v/gen/js/program_test.v +++ b/vlib/v/gen/js/program_test.v @@ -84,7 +84,7 @@ fn check_path(dir string, tests []string) !int { println(found) println('============\n') println('diff:') - println(diff.color_compare_strings(diff_cmd, rand.ulid(), found, expected)) + println(diff.color_compare_strings(diff_cmd, rand.ulid(), expected, found)) println('============\n') nb_fail++ } else {