File: t.assert

package info (click to toggle)
original-awk 2025-08-04-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,400 kB
  • sloc: ansic: 6,369; awk: 1,271; sh: 1,214; yacc: 422; makefile: 73; fortran: 1
file content (9 lines) | stat: -rw-r--r-- 228 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
# tests whether function returns sensible type bits

function assert(cond) { # assertion
    if (!cond) print "   >>> assert failed <<<"
}

function i(x) { return x }

{ m = length($1); n = length($2); n = i(n); assert(m > n) }