Skip to content

Commit

Permalink
fixup! tool/run: introduce generalized 'assert'-proc
Browse files Browse the repository at this point in the history
  • Loading branch information
rite committed Feb 13, 2025
1 parent e19c503 commit da3b393
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tool/run/run
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ proc strip_whitespace {string} {
# This is a reimplementation of TCLs ::control::assert, but tailored for the
# run tool.
#
proc assert {expression args} {
proc assert { expression { msg "" } } {

set code [catch {uplevel 1 [list expr $expression]} res]
if {$code} {
Expand All @@ -43,8 +43,8 @@ proc assert {expression args} {
if {$res} {return}

puts stderr "Test requires '$expression'"
if {[llength $args]} {
puts stderr [join $args]
if {$msg != ""} {
puts stderr $msg
}

exit 1
Expand Down

0 comments on commit da3b393

Please sign in to comment.