/[libconf]/libconf/perl-Libconf/test/pf/test_pf.pl
ViewVC logotype

Diff of /libconf/perl-Libconf/test/pf/test_pf.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by logarno, Mon Apr 21 16:33:10 2003 UTC revision 1.2 by logarno, Fri May 2 08:58:04 2003 UTC
# Line 5  use Data::Dumper; Line 5  use Data::Dumper;
5    
6  my $struct;  my $struct;
7    
8    my $name = 'pf';
9    
10    sub display {
11        local $| = 1;
12        $_[0] == -1 ? print " done\n" : print "\r   * testing $name " . '.' x $_[0];
13        local $| = 0;
14    }
15    
16    sub test {
17        my ($num, $exec) = @_;
18        $exec ||= "diff -q ". $name ."_output_".$num." ".$name."_verify_" .$num ." 2>/dev/null 1>/dev/null";
19        if (system($exec) != 0) {
20            print "\r   * testing $name : TEST N°$num FAILED\n";
21            exit($!);
22        }
23    }
24    
25  # test 1, minimal requirement : regenerate correctly  # test 1, minimal requirement : regenerate correctly
26  $struct = new Libconf("pf.conf", 'pf', '');  display(1);
27    $struct = new Libconf("pf.conf", $name, '');
28    $struct->writeConf("pf_output_1");
29  print Dumper $struct;  print Dumper $struct;
30    test(1);
31    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26