]> diplodocus.org Git - nmh/commitdiff
mhshow/test-charset: Test iconv(1)'s result, not just its exit status.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sat, 23 Sep 2017 13:29:38 +0000 (14:29 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sat, 23 Sep 2017 13:29:38 +0000 (14:29 +0100)
Problems with generating the input to iconv(1) were hidden as long as it
could be converted from EBCDIC-US to UTF-8 because only the exit status
was tested.  Check the output is as expected too.

test/mhshow/test-charset

index 72aeb79..8f19967 100755 (executable)
@@ -29,7 +29,8 @@ else
     #### FreeBSD10 buildbot.  It doesn't support EBCDIC-US, which is used
     #### by the checks, so check for that.  Though that doesn't seem to be
     #### the reason.
     #### FreeBSD10 buildbot.  It doesn't support EBCDIC-US, which is used
     #### by the checks, so check for that.  Though that doesn't seem to be
     #### the reason.
-    printf '\344' | iconv -f EBCDIC-US -t UTF-8 >/dev/null 2>&1  ||
+    utf8="`printf '\344' | iconv -f EBCDIC-US -t UTF-8 2>/dev/null`" &&
+    test x"$utf8" = xU ||
         skip_param_value_checks=1
 fi
 
         skip_param_value_checks=1
 fi