From 15335da1f89be1d13532c4f504ea5070009b44b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Mangano-Tarumi?= Date: Sun, 28 Oct 2018 18:42:21 -0400 Subject: [PATCH] t: check -h too --- t/meta.t | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/t/meta.t b/t/meta.t index 8c5a849..80e8574 100644 --- a/t/meta.t +++ b/t/meta.t @@ -4,7 +4,7 @@ use strict; use warnings; -use Test::More tests => 5; +use Test::More tests => 6; my $opustags = './opustags'; chomp(my $version = `git describe --tags --abbrev=0`); @@ -18,7 +18,7 @@ Usage: opustags --help opustags OPTIONS FILE -o FILE EOF -is(`$opustags --help`, <<"EOF", '--help displays the help message'); +my $help = <<"EOF"; opustags version $version Usage: opustags --help @@ -38,8 +38,12 @@ Options: See the man page for extensive documentation. EOF + +is(`$opustags --help`, $help, '--help displays the help message'); is($?, 0, '--help returns 0'); +is(`$opustags --h`, $help, '-h displays the help message too'); + is(`$opustags --derp 2>&1`, <<'EOF', 'unrecognized option shows an error'); ./opustags: unrecognized option '--derp' EOF