From cc50dcc4918c82cee17d9715ec4bf2d588938042 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 8 Oct 2009 00:59:11 -0700 Subject: tests: add dbgcat() utility method Useful for prefixing individual lines of a temporary file while catting it to stdout. This helps make tests easier to write and test. --- t/test-lib.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/t/test-lib.sh b/t/test-lib.sh index c8e069d..e5b0bc8 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -50,3 +50,9 @@ rtmpfiles () { _TEST_RM_LIST="$_TEST_RM_LIST $_tmp" done } + +dbgcat () { + id=$1 + eval '_file=$'$id + sed -e "s/^/$id:/" < $_file +} -- cgit v1.2.3-24-ge0c7