diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-12-08 13:28:02 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-12-08 13:28:02 +1300 |
commit | 029ffac187cdc3c2829829eee913f2ae6068209c (patch) | |
tree | 31ba9c0c7a34c54de63b461a4c710c8fd580bb43 | |
parent | Merge branch 'feature/test-load' into develop (diff) | |
parent | Add lyrics save() method test (diff) | |
download | Music-Lyrics-LRC-029ffac187cdc3c2829829eee913f2ae6068209c.tar.gz Music-Lyrics-LRC-029ffac187cdc3c2829829eee913f2ae6068209c.zip |
Merge branch 'feature/test-save' into develop
* feature/test-save:
Add lyrics save() method test
-rw-r--r-- | MANIFEST | 1 | ||||
-rw-r--r-- | t/save.t | 26 |
2 files changed, 27 insertions, 0 deletions
@@ -7,6 +7,7 @@ README t/basic.t t/japh.lrc t/load.t +t/save.t xt/manifest.t xt/pod-coverage.t xt/pod.t diff --git a/t/save.t b/t/save.t new file mode 100644 index 0000000..27c5020 --- /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.10'; + +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) |