cli: fix default flags when their command equivalents are disabled (#21469)

* always replace `\r\n` with `\n`

* fix

* test

* cleanup

* add doc comment
This commit is contained in:
Turiiya 2024-05-08 13:11:40 +02:00 committed by GitHub
parent 4320f8641b
commit c0fec31bef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 69 additions and 13 deletions

View file

@ -19,12 +19,8 @@ fn test_cli_programs() {
has_err = true
continue
}
mut expected_out := os.read_file(out_path)!
mut test_out := os.execute('${vexe} run ${test}').output
$if windows {
expected_out = expected_out.replace('\r\n', '\n')
test_out = test_out.replace('\r\n', '\n')
}
expected_out := os.read_file(out_path)!.replace('\r\n', '\n')
test_out := os.execute('${vexe} run ${test}').output.replace('\r\n', '\n')
diff_ := diff.compare_text(expected_out, test_out)!
if diff_ != '' {
println(term.red('FAIL'))