X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F21-layer.t;h=1087d5cae03b2dca912628860851f1fcedde9bea;hb=b212ec02c4010c5200e7741d432397bfede7ca50;hp=6aaafd6b5c67b415e1944f3ad974ba196a704d8a;hpb=32fbc7c8acf36e81b3c3436152e664e79c74dc87;p=perl%2Fmodules%2FLaTeX-TikZ.git diff --git a/t/21-layer.t b/t/21-layer.t index 6aaafd6..1087d5c 100644 --- a/t/21-layer.t +++ b/t/21-layer.t @@ -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