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