aboutsummaryrefslogtreecommitdiff
path: root/t/save.t
diff options
context:
space:
mode:
Diffstat (limited to 't/save.t')
-rw-r--r--t/save.t26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/save.t b/t/save.t
new file mode 100644
index 0000000..ad55df8
--- /dev/null
+++ b/t/save.t
@@ -0,0 +1,26 @@
+#!perl -T
+
+use strict;
+use warnings;
+use utf8;
+
+use 5.006;
+
+use English qw(-no_match_vars);
+use File::Temp qw(tempfile);
+use Test::More tests => 2;
+
+use Music::Lyrics::LRC;
+
+our $VERSION = '0.11';
+
+my $lrc = Music::Lyrics::LRC->new();
+$lrc->set_tag( 'foo', 'bar' );
+$lrc->add_lyric( 0, 'lalala' );
+$lrc->add_lyric( 10, 'doremi' );
+
+my ( $fh, $fn ) = tempfile();
+ok( $lrc->save($fh), 'save' );
+close $fh
+ or die "$ERRNO\n";
+ok( -s $fn == 44, 'length' ); ## no critic (ProhibitMagicNumbers)