From cc5f4e22a5b67874226ff3763e479b953552bd04 Mon Sep 17 00:00:00 2001 From: Andreas Romeyke <andreas.romeyke@slub-dresden.de> Date: Tue, 28 May 2024 11:33:08 +0200 Subject: [PATCH] - added help testcases --- t/03-info.t | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/t/03-info.t b/t/03-info.t index 9e21b1c..4c58b07 100644 --- a/t/03-info.t +++ b/t/03-info.t @@ -1,6 +1,6 @@ use v5.36; use Test::Cmd; -use Test::More tests =>3; +use Test::More tests =>12; use Path::Tiny; my $perl = $^X; my $testapp = Test::Cmd->new( @@ -27,12 +27,20 @@ password: 839852bed005a7f1237578a6ac1197c142f7d0dd58bb248446dc7849d4bf770902e7f9 user: lza _CFG_ # tests + +foreach my $param ("help info", "info -h", "info --help") { + $testapp->run(args => $param); + #say "STDOUT:",$testapp->stdout; + #say "STDERR:",$testapp->stderr; + like($testapp->stdout, qr/this usage screen/, "ta-tool $param, stdout"); + like($testapp->stderr, qr/^$/, "ta-tool $param, stderr"); + is($? >> 8, 0, "ta-tool $param, exit status"); +} + note "elastic search version"; $testapp->run(args =>'info --target-version'); like($testapp->stdout, qr/^6\.\d\.\d{1,2}$/, 'ta-tool elasticsearch version, stdout'); like($testapp->stderr, qr/^$/, 'ta-tool elasticsearch version, stderr'); is($? >> 8, 0, 'ta-tool elasticsearch version, exit status'); - - 1; -- GitLab