forked from nulang-org/nulang
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify.sh
More file actions
executable file
·43 lines (37 loc) · 1.26 KB
/
Copy pathverify.sh
File metadata and controls
executable file
·43 lines (37 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
set -euo pipefail
cd "$(dirname "$0")/.."
NULANG="cargo run --quiet --"
echo "=== Bootstrap Core verification ==="
# 1. self_test.nula: fib(10) = 55
result=$($NULANG bootstrap/self_test.nula 2>&1 | tail -1)
if [ "$result" != "55" ]; then
echo "FAIL: self_test.nula expected 55, got '$result'"
exit 1
fi
echo "PASS: self_test.nula = 55"
# 2. compiler_core.nula: parses 4 expressions, last is 'let x = 42 in x + 1' = 43
result=$($NULANG bootstrap/compiler_core.nula 2>&1 | tail -1)
if [ "$result" != "43" ]; then
echo "FAIL: compiler_core.nula expected 43, got '$result'"
exit 1
fi
echo "PASS: compiler_core.nula = 43"
# 3. host.nula: placeholder shim, returns 0 until Stage 3 wiring
result=$($NULANG bootstrap/host.nula 2>&1 | tail -1)
if [ "$result" != "0" ]; then
echo "FAIL: host.nula expected 0, got '$result'"
exit 1
fi
echo "PASS: host.nula = 0"
# 4. self_test .nbc round-trip
$NULANG --emit-nbc --out bootstrap/self_test.nbc bootstrap/self_test.nula 2>/dev/null
result=$($NULANG bootstrap/self_test.nbc 2>&1 | tail -1)
if [ "$result" != "55" ]; then
echo "FAIL: self_test.nbc expected 55, got '$result'"
exit 1
fi
echo "PASS: self_test.nbc round-trip = 55"
rm -f bootstrap/self_test.nbc
echo ""
echo "=== All bootstrap checks passed ==="