freeze: macro platform complete; default ON with profiles; env consolidation; docs + smokes\n\n- Profiles: --profile {lite|dev|ci|strict} (dev-like default for macros)\n- Macro paths: prefer NYASH_MACRO_PATHS (legacy envs deprecated with warnings)\n- Selfhost pre-expand: auto mode, PyVM-only, add smokes (array/map)\n- Docs: user-macros updated; new macro-profiles guide; AGENTS freeze note; CURRENT_TASK freeze\n- Compat: non-breaking; legacy envs print deprecation notices\n
This commit is contained in:
30
tools/test/golden/macro/identity_user_macro_golden.sh
Normal file
30
tools/test/golden/macro/identity_user_macro_golden.sh
Normal file
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
root=$(cd "$(dirname "$0")"/../../../.. && pwd)
|
||||
bin="$root/target/release/nyash"
|
||||
src="apps/tests/macro_golden_identity.nyash"
|
||||
golden="$root/tools/test/golden/macro/identity.expanded.json"
|
||||
|
||||
if [ ! -x "$bin" ]; then
|
||||
echo "nyash binary not found at $bin; build first (cargo build --release)" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export NYASH_MACRO_BOX_NY=1
|
||||
export NYASH_MACRO_BOX_CHILD_RUNNER=0
|
||||
export NYASH_MACRO_BOX_NY_PATHS="apps/macros/examples/echo_macro.nyash"
|
||||
export NYASH_MACRO_BOX=1
|
||||
|
||||
out=$("$bin" --dump-expanded-ast-json "$src")
|
||||
|
||||
# Strip whitespace for robust compare
|
||||
norm() { tr -d '\n\r\t ' <<< "$1"; }
|
||||
|
||||
if [ "$(norm "$out")" != "$(norm "$(cat "$golden")")" ]; then
|
||||
echo "Golden mismatch (user macro identity)" >&2
|
||||
diff -u <(echo "$out") "$golden" || true
|
||||
exit 2
|
||||
fi
|
||||
|
||||
echo "[OK] golden user macro identity matched"
|
||||
Reference in New Issue
Block a user