]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/blobdiff - t/11-point.t
Factor the check() test function in an helper test module
[perl/modules/LaTeX-TikZ.git] / t / 11-point.t
index 0ceee6c52ea8b0a49670a5a30358b534066fd21e..a8481ec2c844682b22ee5f3ab345b2a3db98abc1 100644 (file)
@@ -9,29 +9,13 @@ use Math::Complex;
 
 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 $z = Math::Complex->make(1, 2);
 
 my $p = eval {