From: Vincent Pit Date: Sun, 18 Jul 2010 23:29:08 +0000 (+0200) Subject: More layer mod folding tests X-Git-Tag: v0.01~41 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=bb03ddd6e84d15713661700e432a24eda2358de6;p=perl%2Fmodules%2FLaTeX-TikZ.git More layer mod folding tests --- 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