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
No known key found for this signature in database
GPG key ID: 66886C0F12D595ED
38 changed files with 119 additions and 112 deletions

View file

@ -69,22 +69,19 @@ fn run_individual_test(case BumpTestCase) ? {
os.rm(test_file) or {}
os.write_file(test_file, case.contents) ?
//
os.execute_or_exit('${os.quoted_path(vexe)} bump --patch ${os.quoted_path(test_file)}')
patch_lines := os.read_lines(test_file) ?
assert patch_lines[case.line] == case.expected_patch
{
os.execute_or_exit('$vexe bump --patch $test_file')
patch_lines := os.read_lines(test_file) ?
assert patch_lines[case.line] == case.expected_patch
}
{
os.execute_or_exit('$vexe bump --minor $test_file')
minor_lines := os.read_lines(test_file) ?
assert minor_lines[case.line] == case.expected_minor
}
{
os.execute_or_exit('$vexe bump --major $test_file')
major_lines := os.read_lines(test_file) ?
assert major_lines[case.line] == case.expected_major
}
os.execute_or_exit('${os.quoted_path(vexe)} bump --minor ${os.quoted_path(test_file)}')
minor_lines := os.read_lines(test_file) ?
assert minor_lines[case.line] == case.expected_minor
os.execute_or_exit('${os.quoted_path(vexe)} bump --major ${os.quoted_path(test_file)}')
major_lines := os.read_lines(test_file) ?
assert major_lines[case.line] == case.expected_major
//
os.rm(test_file) ?
}