File: t030detecterror.t

package info (click to toggle)
libgo-perl 0.15-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,112 kB
  • sloc: perl: 13,147; sh: 21; makefile: 7
file content (36 lines) | stat: -rw-r--r-- 786 bytes parent folder | download | duplicates (8)
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
#!/usr/local/bin/perl -w

# All tests must be run from the software directory;
# make sure we are getting the modules from here:
use lib '.';
BEGIN {
    eval { require Test; };
    use Test;    
    plan tests => 4;
}
use strict;
use GO::Parser;

# ----- REQUIREMENTS -----

# This test script tests the following requirements:
# mistakes in the GO files must be passed to the
# errhandler

# ------------------------

ok(1);
my $parser = 
  new GO::Parser ({format=>'go_ont'});
ok(1);
$parser->cache_errors;
$parser->parse ("./t/data/test_bad_function.dat");

my @errs = $parser->errlist;
print $_->sxpr foreach @errs;
ok(@errs == 2);
$parser->parse ("./t/data/test_bad_function.dat");
@errs = $parser->errlist;
print $_->sxpr foreach @errs;
# lets check we got stuff
ok(@errs == 2);