]> diplodocus.org Git - flac-archive/commitdiff
Two more read_tags tests.
authorEric Gillespie <epg@pretzelnet.org>
Tue, 8 Mar 2022 04:00:46 +0000 (22:00 -0600)
committerEric Gillespie <epg@pretzelnet.org>
Tue, 8 Mar 2022 04:00:46 +0000 (22:00 -0600)
t/read_tags.t
tags.pl

index ff7a65166ee9572e730a00bec5ed5015cfe339f7..a694db526f15b9e29173de4b601523ec8f75c472 100644 (file)
@@ -1,7 +1,7 @@
 use v5.12;
 use warnings;
 
-use Test::Simple tests => 4;
+use Test::Simple tests => 6;
 
 use Test::Differences;
 use Test::Exception;
@@ -100,11 +100,13 @@ eq_or_diff
 $fh = str_file_handle(<<EOF);
 lead off with junk
 EOF
+throws_ok { read_tags($fh) } qr/no field name in:  lead off with junk/;
 
 $fh = str_file_handle(<<EOF);
 ARTIST=Reba McEntire
-starteed off good but went bad...
+started off good but went bad...
 EOF
+throws_ok { read_tags($fh) } qr/no field name in:  started off good/;
 
 exit;
 
diff --git a/tags.pl b/tags.pl
index 301b1dda6a09a48391f01727b1eeadea99320010..2c04fb9e3567e91e798b86dc76dc9a77f8d1df51 100644 (file)
--- a/tags.pl
+++ b/tags.pl
@@ -93,7 +93,7 @@ sub read_tags {
                 warn("looks like DESCRIPTION had multiple lines; discarding and returning early: $_");
                 last
             }
-            die("no field name in $_");
+            die("no field name in $_");
         }
         $name = $1;
         # TODO validate $name