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

os: add os.quoted_path/1, use it consistently for running V itself

This commit is contained in:
Delyan Angelov
2022-01-22 21:13:16 +02:00
parent 85ec0248e9
commit fa6f7d4c83
38 changed files with 119 additions and 112 deletions

View File

@ -1,22 +1,21 @@
import os
const vexe = os.getenv('VEXE')
fn test_help() {
vexe := os.getenv('VEXE')
res := os.execute('"$vexe" help')
res := os.execute('${os.quoted_path(vexe)} help')
assert res.exit_code == 0
assert res.output.starts_with('V is a tool for managing V source code.')
}
fn test_help_as_short_option() {
vexe := os.getenv('VEXE')
res := os.execute('"$vexe" -h')
res := os.execute('${os.quoted_path(vexe)} -h')
assert res.exit_code == 0
assert res.output.starts_with('V is a tool for managing V source code.')
}
fn test_help_as_long_option() {
vexe := os.getenv('VEXE')
res := os.execute('"$vexe" --help')
res := os.execute('${os.quoted_path(vexe)} --help')
assert res.exit_code == 0
assert res.output.starts_with('V is a tool for managing V source code.')
}