From: Vincent Pit Date: Sun, 17 May 2009 19:57:09 +0000 (+0200) Subject: A better test for imports X-Git-Tag: v0.09~3 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FScope-Upper.git;a=commitdiff_plain;h=863af77d1e775a17f481fabf9e994d7513f49f1e A better test for imports --- diff --git a/t/01-import.t b/t/01-import.t index da61bbc..2699c19 100644 --- a/t/01-import.t +++ b/t/01-import.t @@ -3,13 +3,29 @@ use strict; use warnings; -use Test::More tests => 14; +use Test::More tests => 2 * 14; require Scope::Upper; -for (qw/reap localize localize_elem localize_delete unwind want_at - TOP HERE UP SUB EVAL SCOPE CALLER - SU_THREADSAFE/) { +my %syms = ( + reap => '&;$', + localize => '$$;$', + localize_elem => '$$$;$', + localize_delete => '$$;$', + unwind => undef, + want_at => ';$', + TOP => '', + HERE => '', + UP => ';$', + SUB => ';$', + EVAL => ';$', + SCOPE => ';$', + CALLER => ';$', + SU_THREADSAFE => '', +); + +for (keys %syms) { eval { Scope::Upper->import($_) }; - is($@, '', 'import ' . $_); + is $@, '', "import $_"; + is prototype($_), $syms{$_}, "prototype $_"; }