work with new package::stash api
[p5sagit/namespace-clean.git] / t / 01-function-wipeout.t
CommitLineData
40aef9d6 1#!/usr/bin/env perl
2use warnings;
3use strict;
4
5use FindBin;
6use lib "$FindBin::Bin/lib";
53e92ec5 7use Test::More tests => 9;
40aef9d6 8
9use_ok('FunctionWipeout');
10ok( !FunctionWipeout->can('foo'),
11 'imported function removed' );
12ok( !FunctionWipeout->can('bar'),
13 'previously declared function removed' );
14ok( FunctionWipeout->can('baz'),
15 'later declared function still exists' );
16is( FunctionWipeout->baz, 23,
17 'removed functions still bound' );
53e92ec5 18ok( FunctionWipeout->can('qux'),
19 '-except flag keeps import' );
20is( FunctionWipeout->qux, 17,
21 'kept import still works' );
22ok( $FunctionWipeout::foo,
23 'non-code symbol was not removed' );
24is( $FunctionWipeout::foo, 777,
25 'non-code symbol still has correct value' );