File: SimpleFilter.pm

package info (click to toggle)
libfilter-eof-perl 0.04-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 184 kB
  • sloc: perl: 1,083; makefile: 7
file content (36 lines) | stat: -rw-r--r-- 771 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package SimpleFilter;
use warnings;
use strict;

use Filter::EOF;
use base 'Exporter';

our @EXPORT = qw(test_export);

sub import {
    my ($class, @args) = @_;
    Filter::EOF->on_eof_call(sub { 

        $SimpleTest::TEST_ON_EOF       = 1;
        $SimpleTest::TEST_ON_EOF_CLASS = $class;
        $SimpleTest::TEST_PHASE = 'run';

        push @{ $SimpleTest::TEST_ORDER }, 'on_eof';

        my $source = shift;
        $$source .= ";\n\$TEST_MODIFICATION = 1;\n1;\n";
    });

    $SimpleTest::TEST_ON_IMPORT       = 1;
    $SimpleTest::TEST_ON_IMPORT_CLASS = $class;
    $SimpleTest::TEST_ON_IMPORT_ARGS  = \@args;
    $SimpleTest::TEST_PHASE = 'compile';

    $SimpleTest::TEST_ORDER = ['on_import'];

    $class->export_to_level(1);
}

sub test_export { 23 }

1;