Browse Source

* t/format-ssa-style.t : test to_string()

master
Alex 'AdUser' Z 8 years ago
parent
commit
10fd4e1f33
  1. 10
      t/format-ssa-style.t

10
t/format-ssa-style.t

@ -1,11 +1,11 @@
use strict;
use warnings;
use Test::More tests => 47;
use Test::More tests => 51;
use Subtitle::SSA::Style;
my ($fields, @fields, $format, $sample, $style);
my ($fields, @fields, $format, $sample, $style, $output);
# SSA format line
$format = 'Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding';
@ -45,6 +45,9 @@ is($style->{marginv} => 2);
is($style->{alphalevel} => 0);
is($style->{encoding} => 204);
ok($output = $style->to_string(), 'converting SSA style to string');
is($output, $sample);
$sample = 'Style: Default,Georgia,50,&H00F0F4F6,&H008D7127,&H00414B4C,&H00000000,0,0,0,0,100,95,0,0,1,3.5,0,2,11,11,13,204';
$style = Subtitle::SSA::Style->new(version => 'ass');
ok($style->parse($sample), "ASS style parsing test");
@ -72,4 +75,7 @@ is($style->{marginr} => 11);
is($style->{marginv} => 13);
is($style->{encoding} => 204);
ok($output = $style->to_string(), 'converting ASS style to string');
is($output, $sample);
exit 0;

Loading…
Cancel
Save