Files
vercel-labs--zerolang/conformance/native/pass/std-proc-child-cwd.0
T
wehub-resource-sync e7738de6d2
CI / Deep Native Runtime Cases (1/6) (push) Has been skipped
CI / Native Preflight (push) Failing after 1s
CI / Native Runtime Cases (1/2) (push) Failing after 0s
CI / Native Runtime Cases (2/2) (push) Failing after 1s
CI / Native Metadata Reports (push) Failing after 0s
CI / Native Direct Backend Artifacts (push) Failing after 0s
CI / Native Sanitizer Smoke (push) Failing after 1s
CI / Command Contract Snapshots (push) Failing after 1s
CI / Deep Conformance Suite (push) Has been skipped
CI / Graph Build Perf (push) Failing after 1s
CI / Deep Native Preflight (push) Has been skipped
CI / Deep Native Runtime Cases (2/6) (push) Has been skipped
CI / Deep Native Runtime Cases (3/6) (push) Has been skipped
CI / Conformance Suite (push) Failing after 1s
CI / Workspace Checks (push) Failing after 0s
CI / Deep Native Runtime Cases (5/6) (push) Has been skipped
CI / Deep Native Runtime Cases (6/6) (push) Has been skipped
CI / Deep Native Runtime Cases (4/6) (push) Has been skipped
CI / Deep Graph Build Perf (push) Has been skipped
chore: import upstream snapshot with attribution
2026-07-13 12:29:30 +08:00

20 lines
1.0 KiB
Plaintext

pub fn main(world: World) -> Void raises {
let fs: Fs = std.fs.host()
let cwd: String = ".zero/proc-child-cwd"
let ready: Bool = std.fs.makeDir(cwd) || std.fs.isDir(cwd)
let child: ProcChild = std.proc.spawnChildIn("sh -c 'printf stdout-cwd; printf marker > child.txt'", cwd)
var stdout_buf: [32]u8 = [0_u8; 32]
var marker_buf: [32]u8 = [0_u8; 32]
let valid: Bool = std.proc.childValid(child)
let status: ProcStatus = std.proc.wait(child)
let stdout_read: Maybe<usize> = std.proc.readStdout(child, stdout_buf)
let marker: Maybe<Span<u8>> = std.fs.readFileBytes(fs, ".zero/proc-child-cwd/child.txt", marker_buf)
let closed: Bool = std.proc.close(child)
if ready && valid && std.proc.succeeded(status) && stdout_read.has && marker.has && closed {
let stdout_bytes: Span<u8> = std.io.written(stdout_buf, stdout_read.value)
if std.mem.eql(stdout_bytes, "stdout-cwd") && std.mem.eql(marker.value, "marker") {
check world.out.write("std proc child cwd ok\n")
}
}
}