From: Vincent Pit Date: Thu, 22 Jul 2010 20:04:22 +0000 (+0200) Subject: Test formatter origin X-Git-Tag: v0.01~8 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=a31ad833b19a240ea560019c24153d6115aeda88;p=perl%2Fmodules%2FLaTeX-TikZ.git Test formatter origin --- diff --git a/t/30-functor.t b/t/30-functor.t index aff3730..86221e9 100644 --- a/t/30-functor.t +++ b/t/30-functor.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 4 + 2 * 4; +use Test::More tests => 5 + 2 * 5; use LaTeX::TikZ; @@ -121,3 +121,24 @@ check $seq3, 'the stripped sequence', <<'RES'; \draw (1cm,1cm) ; \draw (-2cm,1cm) -- (2cm,1cm) ; RES + +$tikz = eval { + Tikz->formatter( + origin => [ -1, 1 ], + ); +}; +is $@, '', 'creating a formatter object with an origin doesn\'t croak'; + +check $seq, 'a sequence translated by an origin', <<'RES'; +\begin{scope} +\clip (-1cm,0cm) rectangle (1cm,4cm) ; +\draw (-1cm,1cm) ; +\draw foo ; +\draw (1cm,1cm) ; +\begin{scope} +\clip (0cm,1cm) circle (1cm) ; +\draw (-2cm,1cm) -- (2cm,1cm) ; +\end{scope} +\end{scope} +RES +