X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FLaTeX-TikZ.git;a=blobdiff_plain;f=t%2F30-functor.t;fp=t%2F30-functor.t;h=74ff18d727f489e771a7181ebdf784e03eb34204;hp=e455a9d6e1a59bdd73168c6e15257afa0d52097f;hb=93edf9c5c04a04fbd3c8dbf04eacaf66736ff6ee;hpb=cfe1f7a0b769c771181f2cb0d3d8f16a1dac7ad7 diff --git a/t/30-functor.t b/t/30-functor.t index e455a9d..74ff18d 100644 --- a/t/30-functor.t +++ b/t/30-functor.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 10 + 2 * 7; +use Test::More tests => 11 + 2 * 8; use LaTeX::TikZ; @@ -78,6 +78,19 @@ check $seq2, 'the translated sequence', <<'RES'; \end{scope} RES +my $poly = Tikz->closed_polyline( + [ 0, 0 ], [ 1, 0 ], [ 1, 1 ], [ 0, 1 ] +); + +my $poly2 = eval { + $poly->$translate(Tikz->point(-1, 1)); +}; +is $@, '', 'translating a polyline doesn\'t croak'; + +check $poly2, 'the translated polyline', <<'RES'; +\draw (-1cm,1cm) -- (0cm,1cm) -- (0cm,2cm) -- (-1cm,2cm) -- cycle ; +RES + my $strip = eval { Tikz->functor( '+LaTeX::TikZ::Mod' => sub { return },