<requirement name="architecture-stage-gate" stories="architecture">
test -f go.mod
if grep -Eq '^[[:space:]]*require[[:space:](]' go.mod; then
echo "go.mod declares a forbidden third-party dependency" >&2
exit 1
fi
go build ./cmd/toml-decoder
</requirement>
<requirement name="decoder-stage-gate" stories="decoder-contract">
printf 'answer = 42\n' | ./toml-decoder >"$stage_dir/valid.json" 2>"$stage_dir/valid.err"
test ! -s "$stage_dir/valid.err"
python - "$stage_dir/valid.json" <<'PY'
import json
import sys
with open(sys.argv[1], encoding="utf-8") as stream:
decoded = json.load(stream)
assert decoded == {"answer": {"type": "integer", "value": "42"}}
PY
if printf 'answer = [\n' | ./toml-decoder >"$stage_dir/invalid.out" 2>"$stage_dir/invalid.err"; then
echo "malformed TOML exited successfully" >&2
exit 1
fi
test ! -s "$stage_dir/invalid.out"
test -s "$stage_dir/invalid.err"
</requirement>
<unattached story="parser-strings"/>
<unattached story="parser-keys"/>
<unattached story="parser-lexical-scalars"/>
<unattached story="parser-lexical-boundaries"/>
<unattached story="parser-tables"/>
<unattached story="parser-datetimes"/>
<unattached story="parser-arrays-inline"/>
<unattached story="conformance"/>Run artifact