Skip to content

Commit 78d4157

Browse files
authored
tools.vet: update diff comparison in vet_test.v (#21457)
1 parent b53012a commit 78d4157

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

cmd/tools/vvet/vet_test.v

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
import os
2-
import rand
32
import term
43
import v.util.vtest
54
import v.util.diff
65

7-
const diff_cmd = find_diff_cmd()
8-
9-
fn find_diff_cmd() string {
10-
res := diff.find_working_diff_command() or { '' }
11-
return res
12-
}
13-
146
fn test_vet() {
157
vexe := os.getenv('VEXE')
168
vroot := os.dir(vexe)
@@ -44,14 +36,16 @@ fn check_path(vexe string, dir string, tests []string) int {
4436
if expected != found {
4537
println(term.red('FAIL'))
4638
println('============')
47-
println('expected:')
48-
println(expected)
49-
println('============')
50-
println('found:')
51-
println(found)
52-
println('============\n')
53-
println('diff:')
54-
println(diff.color_compare_strings(diff_cmd, rand.ulid(), expected, found))
39+
if diff_ := diff.compare_text(expected, found) {
40+
println('diff:')
41+
println(diff_)
42+
} else {
43+
println('expected:')
44+
println(expected)
45+
println('============')
46+
println('found:')
47+
println(found)
48+
}
5549
println('============\n')
5650
nb_fail++
5751
} else {

0 commit comments

Comments
 (0)