X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FLaTeX-TikZ.git;a=blobdiff_plain;f=t%2F20-mod.t;h=7a68349c197cc7adffe3869e4a24918693582554;hp=50d9db866cac9d996389d610606e7b191dc590b7;hb=d823d115ca3d3718e078dbb986d2c7eb5750df24;hpb=7a0f854a2dc8c6cfacb11841271427df318f4e20 diff --git a/t/20-mod.t b/t/20-mod.t index 50d9db8..7a68349 100644 --- a/t/20-mod.t +++ b/t/20-mod.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 15 + 2 * 18; +use Test::More tests => 19 + 2 * 21; use LaTeX::TikZ; @@ -280,7 +280,7 @@ eval { }; is $@, '', 'creating and adding another width mod doesn\'t croak'; -check $seq, 'mod covering 4', <<'RES'; +check $seq, 'mod covering 5', <<'RES'; \begin{scope} [color=red,raw2] \begin{scope} [line width=4.0pt] \begin{scope} [raw1] @@ -292,3 +292,44 @@ check $seq, 'mod covering 4', <<'RES'; \draw [raw3] baz ; \end{scope} RES + +my ($fred, $fblue) = eval { + map Tikz->fill($_), qw/red blue/; +}; +is $@, '', 'creating two fill mods doesn\'t croak'; + +$seq = eval { + Tikz->seq( + Tikz->raw("foo") + ->mod($fred) + )->mod($fred); +}; +is $@, '', 'creating a structure with two identical fill mods doesn\'t croak'; + +check $seq, 'mod covering 6', <<'RES'; +\draw [fill=red] foo ; +RES + +$seq = eval { + Tikz->seq( + Tikz->raw("foo") + ->mod($fblue) + )->mod($fred); +}; +is $@, '', 'creating a structure with two different fill mods doesn\'t croak'; + +check $seq, 'mod covering 7', <<'RES'; +\draw [fill=red,fill=blue] foo ; +RES + +$seq = eval { + Tikz->seq( + Tikz->raw("foo") + ->mod($red) + )->mod($fred); +}; +is $@, '', 'creating a structure with color and fill mods doesn\'t croak'; + +check $seq, 'mod covering 8', <<'RES'; +\draw [fill=red,color=red] foo ; +RES