X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F20-mod.t;h=191c150bdafe48b8502842d1b712a5e14fb4e146;hb=HEAD;hp=c2c54f8997463203344ab6005400ffbc3253e05e;hpb=65b895926935d98e3bd34b82a6e8b4e4e6b2f09c;p=perl%2Fmodules%2FLaTeX-TikZ.git diff --git a/t/20-mod.t b/t/20-mod.t index c2c54f8..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); };