http://www.perlmonks.org?node_id=1182172

andreas1234567 has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks

PDF::PDFUnit let's us verify PDF documents using perl. It seems to do a good job, except for the notContaining function. It seems to always return true (here a rewritten version of 01-load.t). The basic idea is to detect presence of unwanted words, such as the name of the former CEO:

$ cat t/01-test-mod.t use strict; use utf8; use warnings; use FindBin; use File::Spec; use Test::More; use Test::Exception; use PDF::PDFUnit qw(:skip_on_error); my $resources_dir = File::Spec->catfile($FindBin::Bin, 'resources'); my $pdfReference = "$resources_dir/reference.pdf"; lives_ok { AssertThat ->document($pdfReference) ->hasText() ->containing("Hello") } "containing Hello"; lives_ok { AssertThat ->document($pdfReference) ->hasText() ->notContaining("Hello") } "notContaining Hello"; diag $@->getMessage() if $@; done_testing(); __END__ $ perl t/01-test-mod.t ok 1 - containing Hello ok 2 - notContaining Hello 1..2 $
Do anyone have experience with this module?

openjdk-8-jre:amd64 + Ubuntu 16.04.1 LTS + perl v5.22.1

BR
Andreas

--
No matter how great and destructive your problems may seem now, remember, you've probably only seen the tip of them. [1]