| 1 | #!./perl
|
|---|
| 2 | BEGIN {
|
|---|
| 3 | chdir 't' if -d 't';
|
|---|
| 4 |
|
|---|
| 5 | #For tests within the perl distribution
|
|---|
| 6 | @INC = '../lib' if -d '../lib';
|
|---|
| 7 | END;
|
|---|
| 8 |
|
|---|
| 9 | # Functions exported by FileCache;
|
|---|
| 10 | @funcs = qw[cacheout cacheout_close];
|
|---|
| 11 | $i = 0;
|
|---|
| 12 |
|
|---|
| 13 | # number of tests
|
|---|
| 14 | print "1..8\n";
|
|---|
| 15 | }
|
|---|
| 16 |
|
|---|
| 17 | # Test 6: Test that exporting both works to package main and
|
|---|
| 18 | # other packages. Now using Exporter.
|
|---|
| 19 |
|
|---|
| 20 | # First, we shouldn't be able to have these in our namespace
|
|---|
| 21 | # Add them to BEGIN so the later 'use' doesn't influence this
|
|---|
| 22 | # test
|
|---|
| 23 | BEGIN {
|
|---|
| 24 | for my $f (@funcs) {
|
|---|
| 25 | ++$i;
|
|---|
| 26 | print 'not ' if __PACKAGE__->can($f);
|
|---|
| 27 | print "ok $i\n";
|
|---|
| 28 | }
|
|---|
| 29 | }
|
|---|
| 30 |
|
|---|
| 31 | # With an empty import list, we also shouldn't have them in
|
|---|
| 32 | # our namespace.
|
|---|
| 33 | # Add them to BEGIN so the later 'use' doesn't influence this
|
|---|
| 34 | # test
|
|---|
|
|---|