1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ci: fix failing os_test.v on the CI

This commit is contained in:
Delyan Angelov 2021-11-12 10:27:35 +02:00
parent 20d63de136
commit fcecf527ec
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -848,13 +848,15 @@ fn test_execute() {
} }
// The output of the next command contains a 0 byte in the middle. // The output of the next command contains a 0 byte in the middle.
// Nevertheless, the execute function *should* return a string that // Nevertheless, the execute function *should* return a string that
// contains it: // contains it. NB: TERM, SHELL and HOME are used here, because they are
result := os.execute('printenv --null LANGUAGE LANG') // very likely to be present, unlike LANGUAGE and LANG.
result := os.execute('printenv --null TERM SHELL HOME')
hexresult := result.output.bytes().hex() hexresult := result.output.bytes().hex()
println(result.exit_code) println('exit_code: $result.exit_code')
println(result.output.len) println('output: |$result.output|')
println(hexresult) println('output.len: $result.output.len')
println('output hexresult: $hexresult')
assert result.exit_code == 0 assert result.exit_code == 0
assert result.output.len > 0 assert result.output.len > 0
assert hexresult.contains('00') assert hexresult.contains('002f')
} }