✓
Passing This code compiles and runs correctly.
Code
// Pins that `koruc deps <module>` — the arguments swapped — is REFUSED.
//
// `deps` in the input-file position is intercepted as the builtin toolchain
// check before input resolution runs, so a trailing module used to be discarded
// in silence: it printed a clean toolchain report and exited 0, which reads as
// "this project's dependencies are fine" while naming no project at all.
//
// Every other verb already refuses this, because an unresolvable module in the
// input position is an ordinary error. This pins that `deps` agrees with them,
// and that bare `koruc deps` still works.
~import std/deps
~tor main {}
~proc main|zig {
}
~main()
Flows
flow ~main click a branch to expand · @labels scroll to their anchor
main
Test Configuration
Post-validation Script:
#!/bin/bash
set -e
# Swapped arguments: `input` IS a module here, so the diagnostic must quote the
# line the user meant and exit non-zero.
if OUT=$(koruc deps input 2>&1); then
echo "FAIL: 'koruc deps input' exited 0 — the module argument was discarded"
echo "$OUT"
exit 1
fi
echo "$OUT" | grep -q "wrong way round" || { echo "FAIL: no swap diagnostic"; echo "$OUT"; exit 1; }
echo "$OUT" | grep -q "koruc input deps" || { echo "FAIL: diagnostic did not quote the corrected command"; echo "$OUT"; exit 1; }
# Not a module: still refused, but as an unknown argument rather than a swap.
if OUT2=$(koruc deps definitely-not-a-module 2>&1); then
echo "FAIL: unknown argument accepted"; echo "$OUT2"; exit 1
fi
echo "$OUT2" | grep -q "does not take an argument" || { echo "FAIL: wrong diagnostic for a non-module"; echo "$OUT2"; exit 1; }
# The builtin itself is untouched.
koruc deps > /dev/null 2>&1 || { echo "FAIL: bare 'koruc deps' broke"; exit 1; }
echo "=== Test passed: deps refuses swapped arguments and still checks the toolchain ==="