use LaTeX::TikZ::Interface point => sub {
shift;
- __PACKAGE__->new(point => @_ > 1 ? \@_ : $_[0] );
+ my $point = @_ == 0 ? 0
+ : @_ == 1 ? $_[0]
+ : \@_;
+ __PACKAGE__->new(point => $point);
};
__PACKAGE__->meta->make_immutable;
use strict;
use warnings;
-use Test::More tests => 5 + 2 * 5;
+use Test::More tests => 6 + 2 * 6;
use Math::Complex;
\draw (1cm,-2cm) ;
RES
+$p = eval {
+ Tikz->point;
+};
+is $@, '', 'creating a point from nothing doesn\'t croak';
+
+check $p, 'a point from nothing', <<'RES';
+\draw (0cm,0cm) ;
+RES
+
$p = eval {
Tikz->point(-7);
};