use Any::Moose 'Exporter';
any_moose('Exporter')->setup_import_methods(
- as_is => [ qw<using check> ],
+ as_is => [ qw<using check is_point_ok> ],
);
my $tikz;
return $head, $decl, $body;
}
+sub is_point_ok {
+ my ($p, $x, $y, $desc) = @_;
+
+ my $ok = Test::More::isa_ok($p, 'LaTeX::TikZ::Point', "$desc isa point");
+ if ($ok) {
+ Test::More::cmp_ok($p->x, '==', $x, "$desc x coordinate is right");
+ Test::More::cmp_ok($p->y, '==', $y, "$desc y coordinate is right");
+ } else {
+ Test::More::fail("$desc placeholder $_") for 1, 2;
+ }
+}
+
1;