Files
Odin/tests/core/os/os2/process.odin
2025-05-11 15:35:52 +02:00

27 lines
622 B
Odin

#+build !windows
package tests_core_os_os2
import os "core:os/os2"
import "core:log"
import "core:testing"
@(test)
test_process_exec :: proc(t: ^testing.T) {
state, stdout, stderr, err := os.process_exec({
command = {"echo", "hellope"},
}, context.allocator)
defer delete(stdout)
defer delete(stderr)
if err == .Unsupported {
log.warn("process_exec unsupported")
return
}
testing.expect_value(t, state.exited, true)
testing.expect_value(t, state.success, true)
testing.expect_value(t, err, nil)
testing.expect_value(t, string(stdout), "hellope\n")
testing.expect_value(t, string(stderr), "")
}