Bug 41706: Add a test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Amended:
-    $marc->append_fields( MARC::Field->new( '100', ' ', ' ', a => 'Aristotle.' ) );
-    marc2cites($marc);
+    $marc_record->append_fields( MARC::Field->new( '100', ' ', ' ', a => 'Aristotle.' ) );
+    marc2cites($marc_record);

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Jonathan Druart 2026-06-19 13:29:48 +02:00 committed by Pedro Amorim
parent b60b7c3a3f
commit 8316c01bac
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 9 additions and 1 deletions

View File

@ -3,7 +3,7 @@
use Modern::Perl;
use Test::NoWarnings;
use Test::More tests => 17;
use Test::More tests => 18;
use MARC::Record;
use t::lib::Mocks;
@ -160,3 +160,11 @@ is(
$cites->{'Chicago'}, 'Rowling J.K, . 2011. Harry potter: the cursed child. Hogwarts: Reprints.',
'testing marc2cites'
);
subtest 'prevent warnings in marc2cites' => sub {
plan tests => 1;
my $marc_record = MARC::Record->new();
$marc_record->append_fields( MARC::Field->new( '100', ' ', ' ', a => 'Aristotle.' ) );
marc2cites($marc_record);
pass("Test should not have generated a warning");
};