aboutsummaryrefslogtreecommitdiff
path: root/t/save.t
blob: 3d50c9f729a4c855af0e1fee5d381ada248ad3b6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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.15';

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)