File: util.t

package info (click to toggle)
swissknife 1.75-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,888 kB
  • sloc: perl: 8,520; makefile: 2
file content (46 lines) | stat: -rw-r--r-- 721 bytes parent folder | download | duplicates (5)
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
37
38
39
40
41
42
43
44
45
46
# Swissknife Test Harness Script
# 
# Purpose: 
# Check utility methods.

use Carp;

# * Test loading
BEGIN { 
  $| = 1; print "1..2\n"; 
  use vars qw($loaded); 
  $^W = 0;
}

END {print "not ok 1\n" unless $loaded;}


$loaded = 1;
print "ok 1\n";    # 1st test passes.

sub test ($$;$) {
    my($num, $true,$msg) = @_;
    print($true ? "ok $num\n" : "not ok $num $msg\n");
}

my $where = -d 't' ? "t/" : "";
my $testin = "${where}util.txl";

open (IN, $testin);

use SWISS::Entry;


# Check reply from isCurated():

# Read an entire record at a time
$/ = "\/\/\n";
 
# Read the entries
while (<IN>){
  $entry = SWISS::Entry->fromText($_);
  push @results, $entry->isCurated();
}

test 2, (join "",@results) eq "100";