Commit | Line | Data |
6d6be53e |
1 | #!/usr/bin/perl -w |
2 | |
3 | BEGIN { |
4 | if( $ENV{PERL_CORE} ) { |
5 | chdir 't' if -d 't'; |
6 | @INC = '../lib'; |
7 | } |
8 | else { |
9 | unshift @INC, 't/lib'; |
10 | } |
11 | } |
12 | chdir 't'; |
13 | |
14 | use Test::More tests => 6; |
15 | |
16 | use ExtUtils::MakeMaker; |
17 | use ExtUtils::MM_VMS; |
18 | |
19 | sub test_filter { |
20 | my($text, $vms_text) = @_; |
21 | |
22 | local $Test::Builder::Level = $Test::Builder::Level + 1; |
23 | is( ExtUtils::MM_Any->maketext_filter($text), $text, 'default filter' ); |
24 | is( ExtUtils::MM_VMS->maketext_filter($text), $vms_text, 'VMS filter' ); |
25 | } |
26 | |
27 | |
28 | # VMS filter puts a space after the target |
29 | test_filter(<<'END', <<'VMS'); |
30 | foo: bar |
31 | thing: splat |
32 | END |
33 | foo : bar |
34 | thing: splat |
35 | VMS |
36 | |
37 | |
38 | # And it does it for all targets |
39 | test_filter(<<'END', <<'VMS'); |
40 | foo: bar |
41 | thing: splat |
42 | |
43 | up: down |
44 | yes |
45 | END |
46 | foo : bar |
47 | thing: splat |
48 | |
49 | up : down |
50 | yes |
51 | VMS |
52 | |
53 | |
54 | # And it doesn't mess with macros |
55 | test_filter(<<'END', <<'VMS'); |
56 | CLASS=Foo: Bar |
57 | |
58 | target: stuff |
59 | $(PROGRAM) And::Stuff |
60 | END |
61 | CLASS=Foo: Bar |
62 | |
63 | target : stuff |
64 | $(PROGRAM) And::Stuff |
65 | VMS |