Skip to content

Commit

Permalink
tests: fix diff.color_compare_strings parameter order in test files, …
Browse files Browse the repository at this point in the history
…to make analysing the results easier
  • Loading branch information
spytheman committed Jul 29, 2023
1 parent 112a127 commit 1c2b4e7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/tools/vdoc/tests/vdoc_file_test.v
Expand Up @@ -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')
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/vvet/vet_test.v
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions vlib/v/compiler_errors_test.v
Expand Up @@ -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')
}

Expand Down
2 changes: 1 addition & 1 deletion vlib/v/gen/js/program_test.v
Expand Up @@ -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 {
Expand Down

0 comments on commit 1c2b4e7

Please sign in to comment.