fix: bundled dust cleanup — tools/push3-transpiler (#1034)
Renumber test_transpiler_clamping.sh tests from 5-14 to 6-15 to avoid overlap with test_inject_extraction.sh Test 5 (#1017). Items #1012 (ts-node→tsx) and #986 (CI using npm test) were already resolved by prior commits. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
2d369fbf13
commit
aad8b8e9fd
1 changed files with 20 additions and 20 deletions
|
|
@ -85,8 +85,8 @@ run_transpiler() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# ── Test 5: anchorWidth literal > uint24 max → transpiler error ──────────────
|
# ── Test 6: anchorWidth literal > uint24 max → transpiler error ──────────────
|
||||||
echo "Test 5: anchorWidth = 1e18 (literal) → transpiler error, not silent Solidity failure"
|
echo "Test 6: anchorWidth = 1e18 (literal) → transpiler error, not silent Solidity failure"
|
||||||
|
|
||||||
# Push3 program: push 4 values (discoveryDepth, anchorWidth=1e18, anchorShare, ci).
|
# Push3 program: push 4 values (discoveryDepth, anchorWidth=1e18, anchorShare, ci).
|
||||||
# The transpiler pops top-4 from DYADIC stack; these literals sit on top of the
|
# The transpiler pops top-4 from DYADIC stack; these literals sit on top of the
|
||||||
|
|
@ -103,8 +103,8 @@ assert_contains \
|
||||||
"$STDERR" \
|
"$STDERR" \
|
||||||
"anchorWidth literal (1000000000000000000) is outside uint24 range [0, 16777215]"
|
"anchorWidth literal (1000000000000000000) is outside uint24 range [0, 16777215]"
|
||||||
|
|
||||||
# ── Test 6: valid anchorWidth literal (in range) → accepted, wraps with % (2**24) ─
|
# ── Test 7: valid anchorWidth literal (in range) → accepted, wraps with % (2**24) ─
|
||||||
echo "Test 6: anchorWidth = 100 (valid literal) → accepted, output uses % (2**24)"
|
echo "Test 7: anchorWidth = 100 (valid literal) → accepted, output uses % (2**24)"
|
||||||
|
|
||||||
INPUT_6="$TMPDIR_T/valid_aw.push3"
|
INPUT_6="$TMPDIR_T/valid_aw.push3"
|
||||||
OUTPUT_6="$TMPDIR_T/valid_aw.sol"
|
OUTPUT_6="$TMPDIR_T/valid_aw.sol"
|
||||||
|
|
@ -125,8 +125,8 @@ assert_contains \
|
||||||
"$SOL_6" \
|
"$SOL_6" \
|
||||||
"uint24(100 % (2**24))"
|
"uint24(100 % (2**24))"
|
||||||
|
|
||||||
# ── Test 7: negative ci literal → transpiler error ───────────────────────────
|
# ── Test 8: negative ci literal → transpiler error ───────────────────────────
|
||||||
echo "Test 7: ci = -1 (negative literal) → transpiler error"
|
echo "Test 8: ci = -1 (negative literal) → transpiler error"
|
||||||
|
|
||||||
STDERR=$(run_transpiler "(
|
STDERR=$(run_transpiler "(
|
||||||
300000000000000000
|
300000000000000000
|
||||||
|
|
@ -140,8 +140,8 @@ assert_contains \
|
||||||
"$STDERR" \
|
"$STDERR" \
|
||||||
"ci is a negative literal (-1)"
|
"ci is a negative literal (-1)"
|
||||||
|
|
||||||
# ── Test 8: negative anchorShare literal → transpiler error ──────────────────
|
# ── Test 9: negative anchorShare literal → transpiler error ──────────────────
|
||||||
echo "Test 8: anchorShare = -5 (negative literal) → transpiler error"
|
echo "Test 9: anchorShare = -5 (negative literal) → transpiler error"
|
||||||
|
|
||||||
STDERR=$(run_transpiler "(
|
STDERR=$(run_transpiler "(
|
||||||
300000000000000000
|
300000000000000000
|
||||||
|
|
@ -155,8 +155,8 @@ assert_contains \
|
||||||
"$STDERR" \
|
"$STDERR" \
|
||||||
"anchorShare is a negative literal (-5)"
|
"anchorShare is a negative literal (-5)"
|
||||||
|
|
||||||
# ── Test 9: negative discoveryDepth literal → transpiler error ───────────────
|
# ── Test 10: negative discoveryDepth literal → transpiler error ───────────────
|
||||||
echo "Test 9: discoveryDepth = -99 (negative literal) → transpiler error"
|
echo "Test 10: discoveryDepth = -99 (negative literal) → transpiler error"
|
||||||
|
|
||||||
STDERR=$(run_transpiler "(
|
STDERR=$(run_transpiler "(
|
||||||
-99
|
-99
|
||||||
|
|
@ -170,8 +170,8 @@ assert_contains \
|
||||||
"$STDERR" \
|
"$STDERR" \
|
||||||
"discoveryDepth is a negative literal (-99)"
|
"discoveryDepth is a negative literal (-99)"
|
||||||
|
|
||||||
# ── Test 10: negative anchorWidth literal → transpiler error ─────────────────
|
# ── Test 11: negative anchorWidth literal → transpiler error ─────────────────
|
||||||
echo "Test 10: anchorWidth = -1 (negative literal) → transpiler error"
|
echo "Test 11: anchorWidth = -1 (negative literal) → transpiler error"
|
||||||
|
|
||||||
STDERR=$(run_transpiler "(
|
STDERR=$(run_transpiler "(
|
||||||
300000000000000000
|
300000000000000000
|
||||||
|
|
@ -185,8 +185,8 @@ assert_contains \
|
||||||
"$STDERR" \
|
"$STDERR" \
|
||||||
"anchorWidth literal (-1) is outside uint24 range [0, 16777215]"
|
"anchorWidth literal (-1) is outside uint24 range [0, 16777215]"
|
||||||
|
|
||||||
# ── Test 11: forge build — transpiler output compiles (regression for #900) ──
|
# ── Test 12: forge build — transpiler output compiles (regression for #900) ──
|
||||||
echo "Test 11: forge build on valid transpiler output (regression for #900)"
|
echo "Test 12: forge build on valid transpiler output (regression for #900)"
|
||||||
|
|
||||||
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||||
FORGE_BIN="$(command -v forge 2>/dev/null || true)"
|
FORGE_BIN="$(command -v forge 2>/dev/null || true)"
|
||||||
|
|
@ -217,8 +217,8 @@ else
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ── Test 12: ci literal > 1e18 → transpiler error ────────────────────────────
|
# ── Test 13: ci literal > 1e18 → transpiler error ────────────────────────────
|
||||||
echo "Test 12: ci = 2e18 (literal) → transpiler error"
|
echo "Test 13: ci = 2e18 (literal) → transpiler error"
|
||||||
|
|
||||||
STDERR=$(run_transpiler "(
|
STDERR=$(run_transpiler "(
|
||||||
300000000000000000
|
300000000000000000
|
||||||
|
|
@ -232,8 +232,8 @@ assert_contains \
|
||||||
"$STDERR" \
|
"$STDERR" \
|
||||||
"ci literal (2000000000000000000) exceeds 1e18 (max allowed)"
|
"ci literal (2000000000000000000) exceeds 1e18 (max allowed)"
|
||||||
|
|
||||||
# ── Test 13: anchorShare literal > 1e18 → transpiler error ───────────────────
|
# ── Test 14: anchorShare literal > 1e18 → transpiler error ───────────────────
|
||||||
echo "Test 13: anchorShare = 2e18 (literal) → transpiler error"
|
echo "Test 14: anchorShare = 2e18 (literal) → transpiler error"
|
||||||
|
|
||||||
STDERR=$(run_transpiler "(
|
STDERR=$(run_transpiler "(
|
||||||
300000000000000000
|
300000000000000000
|
||||||
|
|
@ -247,8 +247,8 @@ assert_contains \
|
||||||
"$STDERR" \
|
"$STDERR" \
|
||||||
"anchorShare literal (2000000000000000000) exceeds 1e18 (max allowed)"
|
"anchorShare literal (2000000000000000000) exceeds 1e18 (max allowed)"
|
||||||
|
|
||||||
# ── Test 14: discoveryDepth literal > 1e18 → transpiler error ────────────────
|
# ── Test 15: discoveryDepth literal > 1e18 → transpiler error ────────────────
|
||||||
echo "Test 14: discoveryDepth = 2e18 (literal) → transpiler error"
|
echo "Test 15: discoveryDepth = 2e18 (literal) → transpiler error"
|
||||||
|
|
||||||
STDERR=$(run_transpiler "(
|
STDERR=$(run_transpiler "(
|
||||||
2000000000000000000
|
2000000000000000000
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue