Skip to content

Instantly share code, notes, and snippets.

@ryanfb
Created March 11, 2009 04:05
Show Gist options
  • Save ryanfb/77307 to your computer and use it in GitHub Desktop.
Save ryanfb/77307 to your computer and use it in GitHub Desktop.
proc assert_block {block {message "assert_block failed."}} {
if ![uplevel $block] {
error $message
}
}
proc assert_equal {expected actual {message ""}} {
set full_message [or $message "$expected expected but was\n$actual.\n"]
assert_block {expr {$expected eq $actual}} $full_message
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment