From: Vincent Pit Date: Thu, 26 Feb 2009 17:41:27 +0000 (+0100) Subject: Move the last tests of t/13-padsv.t to t/10-base.t X-Git-Tag: v0.03~9 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FLexical-Types.git;a=commitdiff_plain;h=fddda72b93c368843c49a680eda2953c4c139676 Move the last tests of t/13-padsv.t to t/10-base.t --- diff --git a/MANIFEST b/MANIFEST index 5d9172e..83c16a6 100644 --- a/MANIFEST +++ b/MANIFEST @@ -7,6 +7,7 @@ Types.xs lib/Lexical/Types.pm samples/basic.pl t/00-load.t +t/10-base.t t/11-args.t t/12-integrate.t t/13-padsv.t diff --git a/t/10-base.t b/t/10-base.t new file mode 100644 index 0000000..282863a --- /dev/null +++ b/t/10-base.t @@ -0,0 +1,23 @@ +#!perl -T + +use strict; +use warnings; + +use Test::More tests => 4; + +sub Int::TYPEDSCALAR { (caller(0))[2] } + +{ + use Lexical::Types; + + my Int $a; + is $a, __LINE__-1, 'single'; + + my Int ($b, $c); + is $b, __LINE__-1, 'double (a)'; + is $c, __LINE__-2, 'double (b)'; + + for my Int $d (0) { + is $d, 0, 'for'; + } +} diff --git a/t/13-padsv.t b/t/13-padsv.t index 8061e90..e5409bc 100644 --- a/t/13-padsv.t +++ b/t/13-padsv.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 7; +use Test::More tests => 3; sub Str::TYPEDSCALAR { my $buf = (caller(0))[2]; @@ -25,20 +25,3 @@ sub Str::TYPEDSCALAR { my $z = 7; is $z, 7, 'trick for others'; } - -my $count; -sub Int::TYPEDSCALAR { return ++$count } - -{ package INT; } - -{ - use Lexical::Types as => sub { $_[0] eq 'Int' ? @_ : () }; - - my Int ($x, $y); - is $x, 1, 'successive padany 1'; - is $y, 2, 'successive padany 2'; - - my INT ($z, $t); - is $z, undef, 'successive padany 3'; - is $t, undef, 'successive padany 4'; -}