The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

use strict;
use Test::More 'tests' => 5;
# Test.
my $obj = MARC::Convert::Wikidata::Object->new;
is($obj->full_name, undef, 'Get default full name.');
# Test.
$obj = MARC::Convert::Wikidata::Object->new(
'title' => 'Foo',
);
is($obj->full_name, 'Foo', 'Get explicit full name (without subtitle).');
# Test.
$obj = MARC::Convert::Wikidata::Object->new(
'title' => 'Foo',
'subtitles' => ['Bar'],
);
is($obj->full_name, 'Foo: Bar', 'Get explicit full name (one subtitle).');
# Test.
$obj = MARC::Convert::Wikidata::Object->new(
'title' => 'Foo',
'subtitles' => ['Bar', 'Baz'],
);
is($obj->full_name, 'Foo: Bar: Baz', 'Get explicit full name (two subtitles).');