codekingpro/portable-devtools
115k
1# assert --- assert that a condition is true. Otherwise, exit.2#3# This file and how to use it are described in the manual.4# Therefore, we respectfully advise you to Read The Fine Manual5# for more information.6#7# Arnold Robbins, arnold@skeeve.com, Public Domain8# May, 19939 10function assert(condition, string)11{12 if (! condition) {13 printf("%s:%d: assertion failed: %s\n",14 FILENAME, FNR, string) > "/dev/stderr"15 _assert_exit = 116 exit 117 }18}19 20END {21 if (_assert_exit)22 exit 123}24 