Files
rose-ash/lib/tcl/tests/programs/assert.tcl
giles 95f96efb78
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
tcl: conformance.sh + scoreboard, annotate classic programs
Adds lib/tcl/conformance.sh: runs .tcl programs through the epoch
protocol, compares against # expected: annotations, writes
scoreboard.json and scoreboard.md. All 3 classic programs pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 09:44:44 +00:00

15 lines
238 B
Tcl

# expected: 10
proc assert {expr_str} {
set result [uplevel 1 [list expr $expr_str]]
if {!$result} {
error "Assertion failed: $expr_str"
}
}
set x 42
assert {$x == 42}
assert {$x > 0}
set x 10
assert {$x < 100}
set x