Here are the right helper files.
authorJarkko Hietaniemi <jhi@iki.fi>
Fri, 23 Nov 2001 20:09:36 +0000 (20:09 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Fri, 23 Nov 2001 20:09:36 +0000 (20:09 +0000)
p4raw-id: //depot/perl@13227

MANIFEST
t/lib/Filter/Simple/ExportTest.pm [new file with mode: 0755]
t/lib/Filter/Simple/FilterOnlyTest.pm [new file with mode: 0644]
t/lib/Filter/Simple/FilterTest.pm [new file with mode: 0644]
t/lib/Filter/Simple/ImportTest.pm [new file with mode: 0755]

index dbe9c51..2f61242 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -2080,10 +2080,10 @@ t/lib/dprof/test6_t             Perl code profiler tests
 t/lib/dprof/test6_v            Perl code profiler tests
 t/lib/dprof/V.pm               Perl code profiler tests
 t/lib/filter-util.pl           See if Filter::Util::Call works
-t/lib/Filter/Simple/ExportTest.pm              Helper file for lib/Filter/Simple/t/export.t
-t/lib/Filter/Simple/FilterOnlyTest.pm          Helper file for lib/Filter/Simple/t/filter_only.t
-t/lib/Filter/Simple/FilterTest.pm              Helper file for lib/Filter/Simple/t/filter.t
-t/lib/Filter/Simple/ImportTest.pm              Helper file for lib/Filter/Simple/t/import.t
+t/lib/Filter/Simple/ExportTest.pm      Helper file for Filter::Simple tests 
+t/lib/Filter/Simple/FilterOnlyTest.pm  Helper file for Filter::Simple tests
+t/lib/Filter/Simple/FilterTest.pm      Helper file for Filter::Simple tests
+t/lib/Filter/Simple/ImportTest.pm      Helper file for Filter::Simple tests
 t/lib/h2ph.h                   Test header file for h2ph
 t/lib/h2ph.pht                 Generated output from h2ph.h by h2ph, for comparison
 t/lib/locale/latin1            Part of locale.t in Latin 1
diff --git a/t/lib/Filter/Simple/ExportTest.pm b/t/lib/Filter/Simple/ExportTest.pm
new file mode 100755 (executable)
index 0000000..d6da629
--- /dev/null
@@ -0,0 +1,12 @@
+package ExportTest;
+
+use Filter::Simple;
+use base Exporter;
+
+@EXPORT_OK = qw(ok);
+
+FILTER { s/not// };
+
+sub ok { print "ok @_\n" }
+
+1;
diff --git a/t/lib/Filter/Simple/FilterOnlyTest.pm b/t/lib/Filter/Simple/FilterOnlyTest.pm
new file mode 100644 (file)
index 0000000..856e79d
--- /dev/null
@@ -0,0 +1,11 @@
+package FilterOnlyTest;
+
+use Filter::Simple;
+
+FILTER_ONLY
+       string => sub {
+               my $class = shift;
+               while (my($pat, $str) = splice @_, 0, 2) {
+                       s/$pat/$str/g;
+               }
+       };
diff --git a/t/lib/Filter/Simple/FilterTest.pm b/t/lib/Filter/Simple/FilterTest.pm
new file mode 100644 (file)
index 0000000..c49e280
--- /dev/null
@@ -0,0 +1,12 @@
+package FilterTest;
+
+use Filter::Simple;
+
+FILTER {
+       my $class = shift;
+       while (my($pat, $str) = splice @_, 0, 2) {
+               s/$pat/$str/g;
+       }
+};
+
+1;
diff --git a/t/lib/Filter/Simple/ImportTest.pm b/t/lib/Filter/Simple/ImportTest.pm
new file mode 100755 (executable)
index 0000000..6646a36
--- /dev/null
@@ -0,0 +1,19 @@
+package ImportTest;
+
+use base 'Exporter';
+@EXPORT = qw(say);
+
+sub say { print @_ }
+
+use Filter::Simple;
+
+sub import {
+       my $class = shift;
+       print "ok $_\n" foreach @_;
+       __PACKAGE__->export_to_level(1,$class);
+}
+
+FILTER { s/not // };
+
+
+1;