X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F20-mod.t;h=191c150bdafe48b8502842d1b712a5e14fb4e146;hb=HEAD;hp=ae9cc77c6709ed5b09e540597ec8c2865d6458ef;hpb=1ef0d773dfe4f90087af6a39b06061eaadb44a65;p=perl%2Fmodules%2FLaTeX-TikZ.git diff --git a/t/20-mod.t b/t/20-mod.t index ae9cc77..191c150 100644 --- a/t/20-mod.t +++ b/t/20-mod.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 20 + 2 * 22; +use Test::More tests => 23 + 2 * 24; use LaTeX::TikZ; @@ -50,6 +50,33 @@ eval { }; like $@, failed_valid('LaTeX::TikZ::Mod'), 'trying to use a non LTM mod croaks'; +my $scale = eval { + Tikz->scale(2); +}; +is $@, '', 'creating a scale mod doesn\'t croak'; + +$foo2 = eval { + Tikz->raw('foo') + ->mod($scale); +}; +is $@, '', 'applying a scale mod doesn\'t croak'; + +check $foo2, 'a raw set with a scale mod', <<'RES'; +\draw [scale=2.000] foo ; +RES + +$foo2 = eval { + Tikz->union( + Tikz->raw('foo') + ->mod($scale), + )->mod(Tikz->scale(4)); +}; +is $@, '', 'applying two scale mods doesn\'t croak'; + +check $foo2, 'a union of a raw set with two scale mods', <<'RES'; +\draw [scale=4.000] foo ; +RES + my $width = eval { Tikz->width(25); }; @@ -252,7 +279,7 @@ check $seq, 'mod covering 3', <<'RES'; RES eval { - $baz->mod(Tikz->raw_mod($_)) for qw/raw2 raw3/; + $baz->mod(Tikz->raw_mod($_)) for qw; }; is $@, '', 'creating and adding another raw mod doesn\'t croak'; @@ -288,7 +315,7 @@ check $seq, 'mod covering 5', <<'RES'; RES my ($fred, $fblue) = eval { - map Tikz->fill($_), qw/red blue/; + map Tikz->fill($_), qw; }; is $@, '', 'creating two fill mods doesn\'t croak';