Skip to content
Snippets Groups Projects
Commit 126275e9 authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- added tests for paginations

parent 992dd998
Branches
Tags
No related merge requests found
use v5.36; use v5.36;
use Test::Cmd; use Test::Cmd;
use Test::More tests =>87; use Test::More tests =>93;
use Path::Tiny; use Path::Tiny;
my $perl = $^X; my $perl = $^X;
my $testapp = Test::Cmd->new( my $testapp = Test::Cmd->new(
...@@ -133,5 +133,18 @@ like($testapp->stdout, qr/\Aaipid\n.*47daf26a-02a1-4776-a8db-de04c6708bd2/s, 'ta ...@@ -133,5 +133,18 @@ like($testapp->stdout, qr/\Aaipid\n.*47daf26a-02a1-4776-a8db-de04c6708bd2/s, 'ta
like($testapp->stderr, qr/\Afound 166 results\nreporting results 1 … 10 output as csv\Z/s, 'ta-tool search by pronom-id, existing, stderr'); like($testapp->stderr, qr/\Afound 166 results\nreporting results 1 … 10 output as csv\Z/s, 'ta-tool search by pronom-id, existing, stderr');
is($? >> 8, 0, 'ta-tool search by pronom-id, existing, exit status'); is($? >> 8, 0, 'ta-tool search by pronom-id, existing, exit status');
note "check paginations";
$testapp->run(args =>'search --pronom-id fmt/101 --with-result-index --output-as-csv --startrecord 2 --maxrecords 1');
#say "STDOUT:",$testapp->stdout;
#say "STDERR:",$testapp->stderr;
like($testapp->stdout, qr/\A_idx,aipid\n2,2ed0c682-4565-4320-8247-6da0cc0642f1\Z/s, 'ta-tool search by pronom-id, existing, stdout');
like($testapp->stderr, qr/\Afound 166 results\nreporting results output as csv\Z/s, 'ta-tool search by pronom-id, existing, stderr');
is($? >> 8, 0, 'ta-tool search by pronom-id, existing, exit status');
$testapp->run(args =>'search --pronom-id fmt/101 --with-result-index --output-as-csv --startrecord 3 --maxrecords 2');
#say "STDOUT:",$testapp->stdout;
#say "STDERR:",$testapp->stderr;
like($testapp->stdout, qr/\A_idx,aipid\n3,5687a403-673d-45c1-864f-f7f22a7aadb9\n4,db256475-10bd-40ee-83cc-dab8424346ba\Z/s, 'ta-tool search by pronom-id, existing, stdout');
like($testapp->stderr, qr/\Afound 166 results\nreporting results 3 … 4 output as csv\Z/s, 'ta-tool search by pronom-id, existing, stderr');
is($? >> 8, 0, 'ta-tool search by pronom-id, existing, exit status');
1; 1;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment