X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FLaTeX-TikZ.git;a=blobdiff_plain;f=t%2F11-point.t;h=9e73f15c89b6d47ba2d578eb24525457eff7e721;hp=c7f53cdf11adceee590bffc31cafd1f7a3ff1134;hb=19660696c832bcff26c87d371cccc4ffe118c782;hpb=abde159aad84169c3dbf1aabd21c9d1bf81acf85 diff --git a/t/11-point.t b/t/11-point.t index c7f53cd..9e73f15 100644 --- a/t/11-point.t +++ b/t/11-point.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 1 + 2 * 1; +use Test::More tests => 5 + 2 * 5; use Math::Complex; @@ -42,3 +42,39 @@ is $@, '', 'creating a point from a Math::Complex object doesn\'t croak'; check $p, 'a point from a Math::Complex object', <<'RES'; \draw (1cm,2cm) ; RES + +$p = eval { + Tikz->point(1-2*i); +}; +is $@, '', 'creating a point from a Math::Complex constant object doesn\'t croak'; + +check $p, 'a point from a constant Math::Complex object', <<'RES'; +\draw (1cm,-2cm) ; +RES + +$p = eval { + Tikz->point(-7); +}; +is $@, '', 'creating a point from a numish constant doesn\'t croak'; + +check $p, 'a point from a numish constant', <<'RES'; +\draw (-7cm,0cm) ; +RES + +$p = eval { + Tikz->point(5,-1); +}; +is $@, '', 'creating a point from two numish constants doesn\'t croak'; + +check $p, 'a point from two numish constants', <<'RES'; +\draw (5cm,-1cm) ; +RES + +$p = eval { + Tikz->point([-3, 2]); +}; +is $@, '', 'creating a point from an array ref doesn\'t croak'; + +check $p, 'a point from an array ref', <<'RES'; +\draw (-3cm,2cm) ; +RES