X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F01-api.t;h=36e9166cb87d5641c09bc159e1fab00532023fe2;hb=58dbdba6c44235e491e03288cb9a4ad4223b2cdd;hp=78b56213fc4fd5944282504479af2bc482da6adc;hpb=d934d1a7f7268b248687f14e0ede2723010bf243;p=perl%2Fmodules%2FLaTeX-TikZ.git diff --git a/t/01-api.t b/t/01-api.t index 78b5621..36e9166 100644 --- a/t/01-api.t +++ b/t/01-api.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 5 + 18 + 12; +use Test::More tests => 5 + 24 + 12; use LaTeX::TikZ; @@ -28,14 +28,15 @@ is(prototype('Tikz'), '', 'main::Tikz is actually a constant'); ::is(prototype('T'), '', 'LaTeX::TikZ::TestAPI2::T is actually a constant'); } -my @methods = qw/ +my @methods = qw< + formatter functor raw - path seq + union path seq chain join point line polyline closed_polyline rectangle circle arc arrow raw_mod clip layer - width color fill pattern -/; + scale width color fill pattern +>; for (@methods) { ok(Tikz->can($_), "Tikz evaluates to something that ->can($_)"); @@ -45,7 +46,7 @@ require LaTeX::TikZ::Interface; for my $name (undef, ':)') { eval { - LaTeX::TikZ::Interface->import( + LaTeX::TikZ::Interface->register( $name => sub { }, ); }; @@ -53,7 +54,7 @@ for my $name (undef, ':)') { } eval { - LaTeX::TikZ::Interface->import( + LaTeX::TikZ::Interface->register( 'raw' => sub { }, ); }; @@ -61,7 +62,7 @@ like $@, qr/^'raw' is already defined/, 'already defined'; for my $code (undef, [ ]) { eval { - LaTeX::TikZ::Interface->import( + LaTeX::TikZ::Interface->register( 'foo' => $code, ); }; @@ -69,7 +70,7 @@ for my $code (undef, [ ]) { } eval { - LaTeX::TikZ::Interface->import( + LaTeX::TikZ::Interface->register( 'foo' => sub { @_ }, ); }; @@ -78,7 +79,7 @@ ok(Tikz->can('foo'), 'Tikz evaluates to something that ->can(foo)'); is_deeply [ Tikz->foo('hello') ], [ Tikz, 'hello' ], 'Tikz->foo works'; eval { - LaTeX::TikZ::Interface->import( + LaTeX::TikZ::Interface->register( 'bar' => sub { @_ }, 'baz' => undef, );