From 8b6e64301fb44dd2451480428cf90beb4d5a9d62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Thu, 4 Jun 2026 18:36:11 +0200 Subject: [PATCH] Update integration tests to use extended grep instead of PCRE --- tests/integration.bash | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/integration.bash b/tests/integration.bash index 879811f..d33e299 100755 --- a/tests/integration.bash +++ b/tests/integration.bash @@ -9,21 +9,21 @@ redir=$(echo $base | sed "s,://.*@,://,g") n=0 curl() { - out=$($(which curl) "$@" 2>&1); + out=$(command curl "$@" 2>&1 | sed 's/\r$//'); } match() { - n=$[$n+1] + n=$((n+1)) echo "$out" | grep "$@" >/dev/null && echo -n . || \ (echo ""; echo "Error in test $n: Unable to \"grep $@\" this output:"; echo "$out"; exit 1) || exit 1 } curl -v $base/ match "HTTP/.* 200" -match -iP "Content-Type: text/html[;\r\n]" +match -iE "Content-Type: text/html(;.*)?$" curl -v $base/index.html match "HTTP/.* 302" -match -iP "Location: $redir/[\r\n]" +match -iE "Location: $redir/$" curl -v $base/index.html/ match "HTTP/.* 404" @@ -33,23 +33,23 @@ match "HTTP/.* 404" curl -v $base/blog match "HTTP/.* 200" -match -iP "Content-Type: text/html[;\r\n]" +match -iE "Content-Type: text/html(;.*)?$" curl -v $base/blog.html match "HTTP/.* 302" -match -iP "Location: $redir/blog[\r\n]" +match -iE "Location: $redir/blog$" curl -v $base/blog/ match "HTTP/.* 302" -match -iP "Location: $redir/blog[\r\n]" +match -iE "Location: $redir/blog$" curl -v $base/2019 match "HTTP/.* 302" -match -iP "Location: $redir/blog#2019[\r\n]" +match -iE "Location: $redir/blog#2019$" curl -v $base/2019/ match "HTTP/.* 302" -match -iP "Location: $redir/blog#2019[\r\n]" +match -iE "Location: $redir/blog#2019$" curl -v $base/2000 match "HTTP/.* 404" @@ -59,15 +59,15 @@ match "HTTP/.* 404" curl -v $base/2018/hello-world match "HTTP/.* 200" -match -iP "Content-Type: text/html[;\r\n]" +match -iE "Content-Type: text/html(;.*)?$" curl -v $base/2018/hello-world/ match "HTTP/.* 302" -match -iP "Location: $redir/2018/hello-world[\r\n]" +match -iE "Location: $redir/2018/hello-world$" curl -v $base/contact match "HTTP/.* 200" -match -iP "Content-Type: text/html[;\r\n]" +match -iE "Content-Type: text/html(;.*)?$" curl -v $base/contact -X POST match "HTTP/.* 400" @@ -89,14 +89,14 @@ match "HTTP/.* 400" # budget invalid curl -v $base/contact.html match "HTTP/.* 302" -match -iP "Location: $redir/contact[\r\n]" +match -iE "Location: $redir/contact$" curl -v $base/contact.php match "HTTP/.* 302" -match -iP "Location: $redir/contact[\r\n]" +match -iE "Location: $redir/contact$" curl -v $base/contact/ match "HTTP/.* 302" -match -iP "Location: $redir/contact[\r\n]" +match -iE "Location: $redir/contact$" echo "OK ($n)"