Const/t/15cycletest.t

filter: Statementstmt 96.5% 28 / 29 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod n/a totaltotal 91.8% 34 / 37 CC 1 SCAR 0.2
CC
1
Cov
94%
__ANON__
1.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Const/t/50walking.t ↑ Summary Const/t/01use.t »
1 # -*- perl -*-
2 # Before `make install' is performed this script should be runnable with
3 # `make test'. After `make install' it should work as `perl 1.t'
4  
5 #########################
6  
7 # change 'tests => 1' to 'tests => last_test_to_print';
8 1 ▶use Test::More tests => 6;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
11 #01
12 1 ▶ use_ok('Lingua::Treebank::Const');
Subroutine BEGIN: called CC=1 SCAR=0.0
13 };
14  
15 #########################
16  
17 # Insert your test code below, the Test::More module is use()ed here so read
18 # its man page ( perldoc Test::More ) for help writing this test script.
19  
20 1 ▶use constant PACK => 'Lingua::Treebank::Const';
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 #2
23 1 can_ok(PACK, qw( from_penn_string as_penn_text ) );
24  
25 1 my $d = PACK->new();
26 #3
27 1 ok( defined $d, "new() returned something" );
28 #4
29 1 isa_ok($d, PACK, "and it's a " . PACK);
30  
31 1 my $ex1 = <<EOEX1;
32 (S
33 (NP
34 (NNP Joe)
35 )
36 (VP
37 (VB likes)
38 (NP
39 (NNP Bach)
40 )
41 )
42 (. .)
43 )
44 EOEX1
45  
46 1 $d->from_penn_string($ex1);
47  
48 #5
49 1 ok(1, "passed from_penn_string");
50  
51 #6
52 SKIP: {
53 1 eval { require Devel::Cycle; };
54 1 ▶ skip ("devel::cycle not installed", 1) if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 1 1
55 1 my @cycles;
56 0 ▶ Devel::Cycle::find_cycle($ex1, sub { push @cycles, @_;} );
Subroutine __ANON__: not called CC=1 SCAR=1.2
57 1 is(scalar @cycles, 0, "no reference cycles found");
58 }
59  
« Const/t/50walking.t ↑ Summary Const/t/01use.t »