From: Vincent Pit Date: Wed, 21 Jul 2010 14:12:20 +0000 (+0200) Subject: Test fill mods covering X-Git-Tag: v0.01~26 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FLaTeX-TikZ.git;a=commitdiff_plain;h=d823d115ca3d3718e078dbb986d2c7eb5750df24 Test fill mods covering --- 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