sub mod {
my $set = shift;
- push @{$set->_mods},
- map { $ltm_tc->check($_) ? $_ : $ltm_tc->coerce($_) }
- @_;
+ $ltm_tc->assert_valid($_) for @_;
+
+ push @{$set->_mods}, @_;
$set;
}
use strict;
use warnings;
-use Test::More tests => 14 + 2 * 18;
+use Test::More tests => 15 + 2 * 18;
use LaTeX::TikZ;
\draw [color=red] foo ;
RES
+sub failed_valid {
+ my ($tc) = @_;
+ qr/Validation failed for '\Q$tc\E'/;
+}
+
+eval {
+ Tikz->raw('fail')
+ ->mod(Tikz->raw('epic'));
+};
+like $@, failed_valid('LaTeX::TikZ::Mod'), 'trying to use a non LTM mod croaks';
+
my $width = eval {
Tikz->width(25);
};