Debian Codegraph @

t/basic.t

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 #!/usr/bin/perl -w
2 # -*- Mode: Perl -*-
3 # $Basename$
4 # $Revision: 1.3 $
5 # Author : Ulrich Pfeifer
6 # Created On : Wed Jun 18 19:44:37 2003
7 # Last Modified By: Ulrich Pfeifer
8 # Last Modified On: Tue Oct 21 10:29:42 2008
9 # Language : CPerl
10 #
11 # (C) Copyright 2003, UUNET Deutschland GmbH, Germany
12 #
13 use strict;
14 use Test;
15 BEGIN {
16 if (!eval {
17 require File::Temp;
18 require File::Spec;
19 require Cwd;
20 1;
21 }) {
22 print "1..0 # SKIP: File::Temp and/or File::Spec not available, skipping tests\n";
23 exit(0);
24 }
25 File::Temp->import(qw(tempdir));
26 }
27 BEGIN { plan tests => 2, todo => [] }
28
29 sub run {
30 my ($cmd, $test) = @_;
31
32 local $/;
33 open(SUB, "$^X $cmd < " . File::Spec->devnull . " 2>&1 |") or die $!;
34 my $result = <SUB>;
35 close SUB or return;
36
37 return &$test($result);
38 }
39
40 my $tmp = tempdir(CLEANUP => 1);
41 my $cwd = Cwd::getcwd();
42
43 ok(
44 run(
45 "-Mblib ./perlindex -idir $tmp --index $cwd/README $cwd/MANIFEST $cwd/perlindex.PL",
46 sub { print "[[$_[0]]]\n"; $_[0] =~ /MANIFEST/ }
47 )
48 );
49 ok(
50 run(
51 "-Mblib ./perlindex -idir $tmp --nomenu index",
52 sub { print "[[$_[0]]]\n"; $_[0] =~ /perlindex.PL/ }
53 )
54 );