diff --git a/vlib/v/compiler_errors_test.v b/vlib/v/compiler_errors_test.v index 24a6cb58895689..c5b8e1a5fe59d0 100644 --- a/vlib/v/compiler_errors_test.v +++ b/vlib/v/compiler_errors_test.v @@ -1,5 +1,4 @@ import os -import rand import term import v.util.diff import v.util.vtest @@ -409,10 +408,10 @@ fn chunka(s []u8, chunk_size int) string { fn diff_content(expected string, found string) { println(term.bold(term.yellow('diff: '))) - if diff_cmd := diff.find_working_diff_command() { - println(diff.color_compare_strings(diff_cmd, rand.ulid(), expected, found)) + if diff_ := diff.compare_text(expected, found) { + println(diff_) } else { - println('>>>> could not find a working diff command; dumping bytes instead...') + println('>>>> `${err}`; dumping bytes instead...') println('expected bytes:\n${chunka(expected.bytes(), 25)}') println(' found bytes:\n${chunka(found.bytes(), 25)}') println('============') diff --git a/vlib/v/slow_tests/inout/compiler_test.v b/vlib/v/slow_tests/inout/compiler_test.v index dac54a02ad9db1..ffdc32c9092189 100644 --- a/vlib/v/slow_tests/inout/compiler_test.v +++ b/vlib/v/slow_tests/inout/compiler_test.v @@ -95,16 +95,17 @@ fn test_all() { } if expected != found { println(term.red('FAIL')) - println(term.header('expected:', '-')) - println(expected) - println(term.header('found:', '-')) - println(found) - if diff_cmd != '' { + if diff_ := diff.compare_text(expected, found) { println(term.header('difference:', '-')) - println(diff.color_compare_strings(diff_cmd, rand.ulid(), expected, found)) + println(diff_) } else { - println(term.h_divider('-')) + println(err) + println(term.header('expected:', '-')) + println(expected) + println(term.header('found:', '-')) + println(found) } + println(term.h_divider('-')) total_errors++ } else { println(term.green('OK'))