X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F30-functor.t;h=64d7d4b6023e61c398fdd5fb09864dda41b6652c;hb=1ace068a681d0dea45c546bb6509586212adec98;hp=bdade4b6c6257b1686636a263258de9d3e00582f;hpb=b212ec02c4010c5200e7741d432397bfede7ca50;p=perl%2Fmodules%2FLaTeX-TikZ.git diff --git a/t/30-functor.t b/t/30-functor.t index bdade4b..64d7d4b 100644 --- a/t/30-functor.t +++ b/t/30-functor.t @@ -7,29 +7,13 @@ use Test::More tests => 10 + 2 * 7; use LaTeX::TikZ; -my $tikz = Tikz->formatter( +use lib 't/lib'; +use LaTeX::TikZ::TestHelper; + +using Tikz->formatter( format => '%d', ); -sub check { - my ($set, $desc, $exp) = @_; - - local $Test::Builder::Level = $Test::Builder::Level + 1; - - my ($head, $decl, $body) = eval { - $tikz->render(ref $set eq 'ARRAY' ? @$set : $set); - }; - is $@, '', "$desc: no error"; - - unless (ref $exp eq 'ARRAY') { - $exp = [ split /\n/, $exp ]; - } - unshift @$exp, '\begin{tikzpicture}'; - push @$exp, '\end{tikzpicture}'; - - is_deeply $body, $exp, $desc; -} - my $translate = eval { Tikz->functor( 'LaTeX::TikZ::Set::Point' => sub { @@ -158,7 +142,7 @@ check $res, 'the result of the special functor', <<'RES'; \draw moo ; RES -$tikz = eval { +using eval { Tikz->formatter( origin => [ -1, 1 ], );