use v5.12;
use warnings;
-use Test::Simple tests => 7;
+use Test::More tests => 9;
use Test::Differences;
use Test::Exception;
+use Test::Warnings;
require './tags.pl';
epg::flac::archive::tags->import('read_tags');
Label : UMC (Universal Music Catalogue) - Universal Music\r
EOF
-eq_or_diff
- [read_tags($fh)],
- [
- {
- ARTIST => ['Kim Wilde'],
- ALBUM => ['Close'],
- DISCNUMBER => ['1'],
- DISCTOTAL => ['1'],
- DATE => ['1988'],
- GROUPING => ['Pop'],
- COPYRIGHT => ['℗ 1988 MCA Records Ltd.'],
- GENRE => ['Pop Rock'],
- ALBUMARTIST => ['Kim Wilde'],
- ARTIST => ['Kim Wilde'],
- DESCRIPTION => ['Interprètes : Tony Swain, Producer'],
- TITLE => ['You Came'],
- TRACKNUMBER => ['2'],
- TRACKTOTAL => ['10'],
- },
- [],
- ],
- 'multiple lines in tag';
+my $warning = Test::Warnings::warning {
+ eq_or_diff
+ [ read_tags($fh) ],
+ [
+ {
+ ARTIST => ['Kim Wilde'],
+ ALBUM => ['Close'],
+ DISCNUMBER => ['1'],
+ DISCTOTAL => ['1'],
+ DATE => ['1988'],
+ GROUPING => ['Pop'],
+ COPYRIGHT => ['℗ 1988 MCA Records Ltd.'],
+ GENRE => ['Pop Rock'],
+ ALBUMARTIST => ['Kim Wilde'],
+ ARTIST => ['Kim Wilde'],
+ DESCRIPTION => ['Interprètes : Tony Swain, Producer'],
+ TITLE => ['You Came'],
+ TRACKNUMBER => ['2'],
+ TRACKTOTAL => ['10'],
+ },
+ [],
+ ],
+ 'multiple lines in tag still works';
+};
+like($warning, qr/^looks like DESCRIPTION had multiple lines; discarding and returning early: /)
+ or diag 'got warning(s): ', explain($warning);
$fh = str_file_handle(<<EOF);
ARTIST=Marillion