mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
os: deprecate os.exec (returning ?os.Result), in favour of os.execute, which returns os.Result (#8974)
This commit is contained in:
@ -1,22 +1,24 @@
|
||||
import os
|
||||
|
||||
fn test_syscallwrappers() {
|
||||
if true { return }
|
||||
if true {
|
||||
return
|
||||
}
|
||||
$if linux {
|
||||
$if x64 {
|
||||
exe := os.executable()
|
||||
vdir := os.dir(exe)
|
||||
if vdir.len > 1 {
|
||||
dot_checks := vdir + "/.checks"
|
||||
dot_checks := vdir + '/.checks'
|
||||
assert os.is_dir(dot_checks)
|
||||
|
||||
os.chdir(dot_checks)
|
||||
checks_v := "checks.v"
|
||||
checks_v := 'checks.v'
|
||||
assert os.exists(checks_v)
|
||||
rc := os.exec("v run $checks_v") or { panic(err) }
|
||||
assert !rc.output.contains("V panic: An assertion failed.")
|
||||
assert !rc.output.contains("failed")
|
||||
rc := os.execute_or_panic('v run $checks_v')
|
||||
assert rc.exit_code == 0
|
||||
assert !rc.output.contains('V panic: An assertion failed.')
|
||||
assert !rc.output.contains('failed')
|
||||
} else {
|
||||
panic("Can't find test directory")
|
||||
}
|
||||
|
Reference in New Issue
Block a user