]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/blobdiff - t/12-geo.t
Update VPIT::TestHelpers to 15e8aee3
[perl/modules/LaTeX-TikZ.git] / t / 12-geo.t
index 7ce5d643a2414d94b3d43658c4c37614ea5c1c07..87832f7c75d0d288e00489b74698791880af5046 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;
-}
-
 sub failed_valid {
  my ($tc) = @_;
  qr/Validation failed for '\Q$tc\E'/;
@@ -122,7 +106,7 @@ RES
  like $@, qr/at least two LaTeX::TikZ::Set::Point objects are needed in order to build a polyline/, "creating a $desc from only one Tikz point croaks";
 
  $pl = eval {
-  Tikz->$polyline(qw/foo bar/);
+  Tikz->$polyline(qw<foo bar>);
  };
  like $@, failed_valid('LaTeX::TikZ::Point::Autocoerce'), "creating a $desc from two string croaks";
 }
@@ -206,12 +190,12 @@ RES
 eval {
  Tikz->circle($o => -1);
 };
-like $@, qr/isn't a non-negative real number/,
+like $@, failed_valid('__ANON__'),
                               'creating a circle with a negative radius croaks';
 
 # Arc
 
-$tikz = Tikz->formatter(
+using Tikz->formatter(
  format => "%.03f"
 );