代码拉取完成,页面将自动刷新
#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2020-2023 UnionTech Software Technology Co.,Ltd.
# shellcheck disable=2016
set -e
OUT=/tmp/out
ERR=/tmp/err
touch "$OUT"
touch "$ERR"
: "${UNILANG:=./unilang}"
if test -d "$UNILANG" || test ! -x "$UNILANG"; then
echo "ERROR: Wrong '$UNILANG' found as the interpreter."
exit 1
fi
call_intp()
{
set +e
echo > "$ERR"
# echo "$1" | "$UNILANG" 1> "$OUT" 2> "$ERR"
"$UNILANG" -e "$1" 1> "$OUT" 2> "$ERR"
set -e
}
# NOTE: Test cases should print no errors.
run_case()
{
echo "Running case:" "$1"
if ! (call_intp "$1") || test -s "$ERR"; then
echo "FAIL."
echo "Error:"
cat "$ERR"
else
echo "PASS."
fi
}
if test -n "$PTC"; then
# NOTE: Test cases should print no errors.
echo "The following case are expected to be non-terminating."
echo "However, the maximum memory consumption is expected constant."
echo "Please exit manually by SIGINT."
run_case '$defl! f (n) $if #t (f n); f 1'
fi
# Sanity.
run_case 'display'
# Documented examples.
run_case 'load "test.txt"'
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。