X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FLaTeX-TikZ.git;a=blobdiff_plain;f=t%2F11-point.t;h=4b31a503ea25690b0a0621aca3a31da1224b80d6;hp=a8481ec2c844682b22ee5f3ab345b2a3db98abc1;hb=6832c809e7591e1c3e2809654f814c298d28d2ef;hpb=95aada0ec5b3c5a0d78ed0ad53436b0e70860bc7 diff --git a/t/11-point.t b/t/11-point.t index a8481ec..4b31a50 100644 --- a/t/11-point.t +++ b/t/11-point.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 8 + 2 * 8; +use Test::More tests => 8 + 2 * 8 + 2 * (1 + 2 * 3); use Math::Complex; @@ -97,3 +97,25 @@ is $@, '', check $p, 'a labeled positioned point', <<'RES'; \draw (2cm,-2cm) [fill] circle (0.4pt) node[scale=0.20,below right] {bar} ; RES + +my $union = eval { + Tikz->union( + Tikz->point([ 0, -1 ]), + Tikz->raw("foo"), + Tikz->point(9) + ); +}; +is $@, '', 'creating a simple union path doesn\'t croak'; +is_point_ok $union->begin, 0, -1, 'beginning of a simple union path'; +is_point_ok $union->end, 9, 0, 'end of a simple union path'; + +my $path = eval { + Tikz->union( + Tikz->join('--' => 1, 2, 3), + $union, + Tikz->chain(5 => '--' => [ 6, 1 ]), + ); +}; +is $@, '', 'creating a complex union path doesn\'t croak'; +is_point_ok $path->begin, 1, 0, 'beginning of a complex union path'; +is_point_ok $path->end, 6, 1, 'end of a complex union path';