]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/blobdiff - t/20-mod.t
Introduce LaTeX::TikZ::Mod::Scale
[perl/modules/LaTeX-TikZ.git] / t / 20-mod.t
index c2c54f8997463203344ab6005400ffbc3253e05e..191c150bdafe48b8502842d1b712a5e14fb4e146 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 20 + 2 * 22;
+use Test::More tests => 23 + 2 * 24;
 
 use LaTeX::TikZ;
 
@@ -50,6 +50,33 @@ eval {
 };
 like $@, failed_valid('LaTeX::TikZ::Mod'), 'trying to use a non LTM mod croaks';
 
+my $scale = eval {
+ Tikz->scale(2);
+};
+is $@, '', 'creating a scale mod doesn\'t croak';
+
+$foo2 = eval {
+ Tikz->raw('foo')
+     ->mod($scale);
+};
+is $@, '', 'applying a scale mod doesn\'t croak';
+
+check $foo2, 'a raw set with a scale mod', <<'RES';
+\draw [scale=2.000] foo ;
+RES
+
+$foo2 = eval {
+ Tikz->union(
+  Tikz->raw('foo')
+      ->mod($scale),
+ )->mod(Tikz->scale(4));
+};
+is $@, '', 'applying two scale mods doesn\'t croak';
+
+check $foo2, 'a union of a raw set with two scale mods', <<'RES';
+\draw [scale=4.000] foo ;
+RES
+
 my $width = eval {
  Tikz->width(25);
 };