]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/blobdiff - t/11-point.t
Test labeled points
[perl/modules/LaTeX-TikZ.git] / t / 11-point.t
index 7bd64d6568312043ad9aa15fe5beea22d07a40f0..0ceee6c52ea8b0a49670a5a30358b534066fd21e 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 6 + 2 * 6;
+use Test::More tests => 8 + 2 * 8;
 
 use Math::Complex;
 
@@ -87,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