]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/commitdiff
More layer mod folding tests
authorVincent Pit <vince@profvince.com>
Sun, 18 Jul 2010 23:29:08 +0000 (01:29 +0200)
committerVincent Pit <vince@profvince.com>
Sun, 18 Jul 2010 23:29:08 +0000 (01:29 +0200)
t/21-layer.t

index 6aaafd6b5c67b415e1944f3ad974ba196a704d8a..1087d5cae03b2dca912628860851f1fcedde9bea 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 9 + 3 * 6;
+use Test::More tests => 9 + 3 * 10;
 
 use LaTeX::TikZ;
 
@@ -174,3 +174,57 @@ check $seq2, 'mods folding with layers 3', <<'RES', [ qw/middle top/ ];
 \end{scope}
 RES
 
+my $qux = Tikz->raw('qux');
+$seq2 = Tikz->seq($qux, $foo)
+            ->mod($red);
+
+check $seq2, 'mods folding with layers 4', <<'RES', [ 'middle' ];
+\begin{scope} [color=red]
+\draw qux ;
+\begin{pgfonlayer}{middle}
+\draw [color=red] foo ;
+\end{pgfonlayer}
+\end{scope}
+RES
+
+my $seq3 = Tikz->seq($seq2, $bar)
+               ->mod($red);
+
+check $seq3, 'mods folding with layers 5', <<'RES', [ qw/middle top/ ];
+\begin{scope} [color=red]
+\draw qux ;
+\begin{pgfonlayer}{middle}
+\draw [color=red] foo ;
+\end{pgfonlayer}
+\begin{pgfonlayer}{top}
+\draw [color=red] bar ;
+\end{pgfonlayer}
+\end{scope}
+RES
+
+$seq3 = Tikz->seq($bar, $seq2)
+            ->mod($red);
+
+check $seq3, 'mods folding with layers 6', <<'RES', [ qw/middle top/ ];
+\begin{scope} [color=red]
+\begin{pgfonlayer}{top}
+\draw [color=red] bar ;
+\end{pgfonlayer}
+\draw qux ;
+\begin{pgfonlayer}{middle}
+\draw [color=red] foo ;
+\end{pgfonlayer}
+\end{scope}
+RES
+
+my $blue = Tikz->color('blue');
+$qux->mod($blue);
+
+check $seq2, 'mods folding with layers 7', <<'RES', [ 'middle' ];
+\begin{scope} [color=red]
+\draw [color=blue] qux ;
+\begin{pgfonlayer}{middle}
+\draw [color=red] foo ;
+\end{pgfonlayer}
+\end{scope}
+RES