interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / om / blake3 / test-output.sh

21 lines · 975 bytes Raw Blame History
1#!/bin/sh
2# Host output-contract regression. Pass a freshly compiled blake3.om binary.
3# Does not compile, access the GPU, or change the live server.
4set -eu
5[ "$#" -eq 1 ] || { echo 'usage: test-output.sh /path/to/blake3' >&2; exit 2; }
6B=$1
7[ -x "$B" ] || { echo 'FAIL: binary is not executable' >&2; exit 1; }
8[ -c /dev/full ] || { echo 'NOT_RUN: /dev/full unavailable' >&2; exit 77; }
9T=$(mktemp -d)
10trap 'rm -rf "$T"' EXIT HUP INT TERM
11bad() { printf 'FAIL: %s\n' "$*" >&2; exit 1; }
12"$B" </dev/null >"$T/out" || bad 'empty-input control failed'
13printf '%s\n' af1349b9f5f9a1a6a0404dea36dcc9499bcb25c9adc112b7cc9a93cae41f3262 >"$T/want"
14cmp "$T/want" "$T/out" || bad 'empty-input digest or newline differs'
15rc=0
16"$B" </dev/null >/dev/full || rc=$?
17[ "$rc" -eq 74 ] || bad "/dev/full returned $rc, wanted 74"
18rc=0
19"$B" </dev/null 1>&- || rc=$?
20[ "$rc" -eq 74 ] || bad "closed stdout returned $rc, wanted 74"
21printf '%s\n' 'PASS: empty digest, /dev/full and closed stdout'