6 use Test::More tests => 5 + 2 * 5;
12 my $tikz = Tikz->formatter(
17 my ($set, $desc, $exp) = @_;
19 local $Test::Builder::Level = $Test::Builder::Level + 1;
21 my ($head, $decl, $body) = eval {
22 $tikz->render(ref $set eq 'ARRAY' ? @$set : $set);
24 is $@, '', "$desc: no error";
26 unless (ref $exp eq 'ARRAY') {
27 $exp = [ split /\n/, $exp ];
29 unshift @$exp, '\begin{tikzpicture}';
30 push @$exp, '\end{tikzpicture}';
32 is_deeply $body, $exp, $desc;
35 my $z = Math::Complex->make(1, 2);
40 is $@, '', 'creating a point from a Math::Complex object doesn\'t croak';
42 check $p, 'a point from a Math::Complex object', <<'RES';
49 is $@, '', 'creating a point from a Math::Complex constant object doesn\'t croak';
51 check $p, 'a point from a constant Math::Complex object', <<'RES';
58 is $@, '', 'creating a point from a numish constant doesn\'t croak';
60 check $p, 'a point from a numish constant', <<'RES';
67 is $@, '', 'creating a point from two numish constants doesn\'t croak';
69 check $p, 'a point from two numish constants', <<'RES';
76 is $@, '', 'creating a point from an array ref doesn\'t croak';
78 check $p, 'a point from an array ref', <<'RES';