+
+my $album = {
+ ARTIST => ['Marillion'],
+ ALBUM => ["An Hour Before It's Dark"],
+ DATE => ['2022-03-04'],
+};
+my $tracks = [
+ {
+ TITLE => ['Care'],
+ PART => ['IV. Angels On Earth'],
+ PARTNUMBER => [4],
+ },
+ {
+ TITLE => ['(silence)'],
+ },
+ {
+ TITLE => ['Murder Machines'],
+ VERSION => ['12 inch remix'],
+ },
+ {
+ TITLE => ['testing both and with leading 0'],
+ PARTNUMBER => ['04'],
+ VERSION => ['live'],
+ },
+ {
+ TITLE => ['(silence)'],
+ },
+ {
+ TITLE => ['Murder Machines'],
+ VERSION => ['12 inch remix'],
+ },
+];
+is epg::flac::archive::encode::filename(
+ 1, {epg::flac::archive::tags::track_tags_from_disc($album, $tracks, 1)},
+ ),
+ '01-Care-4.flac',
+ 'PART goes into filename, PARTNUMBER ignored';
+
+is epg::flac::archive::encode::filename(
+ 2, {epg::flac::archive::tags::track_tags_from_disc($album, $tracks, 2)},
+ ),
+ '02-silence.flac',
+ 'parens in track title omitted';
+
+is epg::flac::archive::encode::filename(
+ 3, {epg::flac::archive::tags::track_tags_from_disc($album, $tracks, 3)},
+ ),
+ '03-Murder_Machines-12_inch_remix.flac',
+ 'VERSION goes into filename';
+
+is epg::flac::archive::encode::filename(
+ 4, {epg::flac::archive::tags::track_tags_from_disc($album, $tracks, 4)},
+ ),
+ '04-testing_both_and_with_leading_0-live-04.flac',
+ 'PARTNUMBER with leading 0 and VERSION';