From c42b22f8fd93848c8a2d38daf68374b0afa2560c Mon Sep 17 00:00:00 2001 From: Hadi Moshayedi Date: Wed, 12 Jun 2019 17:09:48 -0700 Subject: [PATCH] Fix test name detection in bin/diff --- src/test/regress/bin/diff | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/test/regress/bin/diff b/src/test/regress/bin/diff index c1628144a..a2b3e6f64 100755 --- a/src/test/regress/bin/diff +++ b/src/test/regress/bin/diff @@ -12,7 +12,12 @@ file1="${@:(-2):1}" file2="${@:(-1):1}" -test=$(basename $file1 .out) +# pg_regress passes the expected file as the first argument ($file1 above), +# and results file as the second argument ($file2 above). We take the base +# filename of the expected file as the test name. We can have multiple +# expected files for a single test with _0, _1, ... suffixes. +# So for the test name, we also strip the additional suffix. +test=$(basename $file1 .out | sed -E "s/_[0-9]+$//") args=${@:1:$#-2} BASEDIR=$(dirname "$0")