X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F11-point.t;h=0ceee6c52ea8b0a49670a5a30358b534066fd21e;hb=b212ec02c4010c5200e7741d432397bfede7ca50;hp=9e73f15c89b6d47ba2d578eb24525457eff7e721;hpb=19660696c832bcff26c87d371cccc4ffe118c782;p=perl%2Fmodules%2FLaTeX-TikZ.git diff --git a/t/11-point.t b/t/11-point.t index 9e73f15..0ceee6c 100644 --- a/t/11-point.t +++ b/t/11-point.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 5 + 2 * 5; +use Test::More tests => 8 + 2 * 8; use Math::Complex; @@ -52,6 +52,15 @@ check $p, 'a point from a constant Math::Complex object', <<'RES'; \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); }; @@ -78,3 +87,29 @@ is $@, '', 'creating a point from an array ref doesn\'t croak'; check $p, 'a point from an array ref', <<'RES'; \draw (-3cm,2cm) ; RES + +$p = eval { + Tikz->point( + [1,-1], + label => 'foo', + ); +}; +is $@, '', 'creating a labeled point from an array ref doesn\'t croak'; + +check $p, 'a labeled point', <<'RES'; +\draw (1cm,-1cm) [fill] circle (0.4pt) node[scale=0.20,above] {foo} ; +RES + +$p = eval { + Tikz->point( + [2,-2], + label => 'bar', + pos => 'below right', + ); +}; +is $@, '', + 'creating a labeled positioned point from an array ref doesn\'t croak'; + +check $p, 'a labeled positioned point', <<'RES'; +\draw (2cm,-2cm) [fill] circle (0.4pt) node[scale=0.20,below right] {bar} ; +RES