From c9addba5cc770d2d231b34f6739f32c6be8690f1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 21:37:10 +0200 Subject: Adding upstream version 2.12.0. Signed-off-by: Daniel Baumann --- src/tests/man-recode-suffix | 50 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 src/tests/man-recode-suffix (limited to 'src/tests/man-recode-suffix') diff --git a/src/tests/man-recode-suffix b/src/tests/man-recode-suffix new file mode 100755 index 0000000..75b9424 --- /dev/null +++ b/src/tests/man-recode-suffix @@ -0,0 +1,50 @@ +#! /bin/sh + +# Test man-recode's --suffix behaviour. + +: "${srcdir=.}" +# shellcheck source-path=SCRIPTDIR +. "$srcdir/testlib.sh" + +: "${MAN_RECODE=man-recode}" + +init + +cat >"$tmpdir/a.1.exp" <<'EOF' +.SH NAME +a \- á +EOF +cp "$tmpdir/a.1.exp" "$tmpdir/a.1" +cat >"$tmpdir/b.1.exp" <<'EOF' +'\" -*- coding: UTF-8 -*- +.SH NAME +b \- é +EOF +gzip -c <"$tmpdir/b.1.exp" >"$tmpdir/b.1.gz" +cat >"$tmpdir/c.1.exp" <<'EOF' +'\" -*- coding: UTF-8 +.SH NAME +b \- é +EOF +cat >"$tmpdir/c.1" <<'EOF' +'\" -*- coding: ISO-8859-1 +EOF +<"$tmpdir/c.1.exp" tail -n +2 | iconv -f UTF-8 -t ISO-8859-1 >>"$tmpdir/c.1" +gzip "$tmpdir/c.1" + +run $MAN_RECODE -t UTF-8 --suffix .out \ + "$tmpdir/a.1" "$tmpdir/b.1.gz" "$tmpdir/c.1.gz" +expect_files_equal '--suffix with no coding tag' \ + "$tmpdir/a.1.exp" "$tmpdir/a.1.out" +expect_files_equal \ + '--suffix with gzip and coding tag matching target encoding' \ + "$tmpdir/b.1.exp" "$tmpdir/b.1.out" +if [ "$HAVE_ICONV" = yes ]; then + expect_files_equal \ + '--suffix with gzip and coding tag not matching target encoding' \ + "$tmpdir/c.1.exp" "$tmpdir/c.1.out" +else + report_skip '--suffix with gzip and coding tag not matching target encoding' +fi + +finish -- cgit v1.2.3