tests: make output of vlib/v/compiler_errors_test.v more readable
parent
1f8ae5d12c
commit
a7f484d9a7
|
@ -1,5 +1,6 @@
|
||||||
import os
|
import os
|
||||||
import term
|
import term
|
||||||
|
import v.util
|
||||||
|
|
||||||
fn test_all() {
|
fn test_all() {
|
||||||
mut total_errors := 0
|
mut total_errors := 0
|
||||||
|
@ -75,6 +76,7 @@ fn check_path(vexe, dir, voptions, result_extension string, tests []string) int
|
||||||
println('found:')
|
println('found:')
|
||||||
println(found)
|
println(found)
|
||||||
println('============\n')
|
println('============\n')
|
||||||
|
diff_content( expected, found )
|
||||||
nb_fail++
|
nb_fail++
|
||||||
} else {
|
} else {
|
||||||
println(term.green('OK'))
|
println(term.green('OK'))
|
||||||
|
@ -92,3 +94,10 @@ fn clean_line_endings(s string) string {
|
||||||
res = res.trim('\n')
|
res = res.trim('\n')
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn diff_content(s1 string, s2 string) {
|
||||||
|
diff_cmd := util.find_working_diff_command() or { return }
|
||||||
|
println('diff: ')
|
||||||
|
println( util.color_compare_strings(diff_cmd, s1, s2) )
|
||||||
|
println('============\n')
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue