Files
hakorune/tools/test/smoke/macro/macro_ctx_json_smoke.sh
Selfhosting Dev c8063c9e41 pyvm: split op handlers into ops_core/ops_box/ops_ctrl; add ops_flow + intrinsic; delegate vm.py without behavior change
net-plugin: modularize constants (consts.rs) and sockets (sockets.rs); remove legacy commented socket code; fix unused imports
mir: move instruction unit tests to tests/mir_instruction_unit.rs (file lean-up); no semantic changes
runner/pyvm: ensure using pre-strip; misc docs updates

Build: cargo build ok; legacy cfg warnings remain as before
2025-09-21 08:53:00 +09:00

25 lines
826 B
Bash

#!/usr/bin/env bash
set -euo pipefail
root=$(cd "$(dirname "$0")"/../../../.. && pwd)
bin="$root/target/release/nyash"
src="apps/tests/macro/strings/env_tag_demo.nyash"
if [ ! -x "$bin" ]; then
echo "nyash binary not found at $bin; build first (cargo build --release)" >&2
exit 1
fi
export NYASH_MACRO_ENABLE=1
export NYASH_MACRO_PATHS="apps/macros/examples/env_tag_string_macro.nyash"
unset NYASH_MACRO_CAP_ENV || true
raw=$("$bin" --dump-expanded-ast-json "$root/$src")
export NYASH_MACRO_CTX_JSON='{"caps":{"io":false,"net":false,"env":true}}'
out=$(printf '%s' "$raw" | "$bin" --macro-expand-child apps/macros/examples/env_tag_string_macro.nyash)
echo "$out" | rg -q '"value":"hello \[ENV\]"' && { echo "[OK] macro ctx json smoke"; exit 0; }
echo "[FAIL] macro ctx json smoke (no tag)" >&2
echo "$out" >&2
exit 2