Portable tst suites (awk trim instead of GNU tac) for macOS compatibility
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -38,7 +38,7 @@ bold=$'\033[1m'
|
||||
reset=$'\033[0m'
|
||||
|
||||
# strip leading/trailing blank lines and trailing whitespace
|
||||
trim() { sed -e 's/[[:space:]]*$//' | sed -e '/./,$!d' | tac | sed -e '/./,$!d' | tac; }
|
||||
trim() { awk '{ sub(/[ \t\r]+$/, "") } { line[NR]=$0 } END { f=1; while (f<=NR && line[f]=="") f++; l=NR; while (l>=1 && line[l]=="") l--; for (i=f;i<=l;i++) print line[i] }'; }
|
||||
|
||||
# check_eq NAME EXPECTED KTEXT_ARGS... — exit 0, stdout==EXPECTED, and NO warning.
|
||||
check_eq() {
|
||||
|
||||
Reference in New Issue
Block a user