18 May 2013 19:46
[PATCH 1/2] tests: introduce strip_header() helper function
This means that we can avoid hardcoding the number of headers we expect CGit to generate in test cases and simply remove whatever headers happen to by there when we are checking body content. Signed-off-by: John Keeping <john@...> --- This was previously sent with a different command message and justification[1] but wasn't picked up. I still think this is a useful function to have in the test suite and it's used by patch 2/2 here. tests/setup.sh | 8 ++++++++ tests/t0107-snapshot.sh | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/setup.sh b/tests/setup.sh index a573444..1d8677a 100755 --- a/tests/setup.sh +++ b/tests/setup.sh <at> <at> -98,4 +98,12 <at> <at> cgit_url() CGIT_CONFIG="$PWD/cgitrc" QUERY_STRING="url=$1" cgit } +strip_headers () { + while read -r line + do + test -z "$line" && break + done + cat +} +(Continue reading)
RSS Feed