
##  ReDIF perl suite test script:
##     ReDIF::init.pm
## 
##
##

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

$rr::Options{Buffer} = 1;

# BEGIN { push @ARGV, '--spec' , './spec/redif.spec'; } 
use rr;

$redif_spec_filename = $ReDIF::CONFIG{spec_full_name}; 
print "redif.spec: $redif_spec_filename\n";

$loaded = 1;

print "ok 1\n";

### ::initialize( { silent_init => 1 }  );

my $t = rr::OpenRDF ( "t/test2.rdf" ) ;
if ( not $t ) {
    print "not ok 2\n";
    exit;
} 
  
print "ok 2\n";

$t = rr::NextTemplate();

if ($t) {
    print "ok 3\n";
} else {
    print "not ok 3\n";
}      

my $ed_email = $HashT{'editor'}[0]{'email'}; 
my $ed_wp_email = $HashT{'editor'}[0]{workplace}[0]{'email'}; 

if ( not defined ( $ed_email ) 
   or $ed_email ne 'layard@center.ac' ){
    print "not ok 4\n";
    if( $ed_email ) { print "$ed_email\n"; }
} else {
    print "ok 4\n";
}

if ( $ed_wp_email ) { 
    print "not ok 5 ($ed_wp_email)\n";
} else {
    print "ok 5\n";
}


1;




