This commit is contained in:
ge
2025-12-28 20:42:30 +03:00
commit 7a67749f1f
20 changed files with 1130 additions and 0 deletions

24
runcmd_test.v Normal file
View File

@@ -0,0 +1,24 @@
import runcmd
import os
import io.util
fn make_temp_file() !string {
_, path := util.temp_file()!
os.chmod(path, 0o700)!
dump(path)
return path
}
fn test_lookup() {
path := make_temp_file()!
defer { os.rm(path) or {} }
assert os.is_abs_path(runcmd.look_path(path)!)
assert runcmd.look_path('/nonexistent') or { '' } == ''
assert runcmd.look_path('env')! == '/usr/bin/env'
}
fn test_is_present() {
path := make_temp_file()!
defer { os.rm(path) or {} }
assert runcmd.is_present(path)
}