lib/t/config.t

filter: Statementstmt 82.6% 19 / 23 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 82.3% 28 / 34 CC 3 SCAR 6.7
CC
3
Cov
78%
BEGIN
3.8
BEGIN
1.3
BEGIN
1.0
CRAP 2.0
« blib/script/make_par.pl ↑ Summary blib/lib/PAR/WebStart/PNLP.pm »
1 #!/usr/bin/perl
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Test;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use File::Which;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶BEGIN {
Subroutine BEGIN: called CC=3 SCAR=13.3
7 1 ▶ my $has_par = ($^O eq 'MSWin32') ? which('par') : which('par.pl');
Branch: 1 branch
BranchTrueFalseTotal
$^O eq 'MSWin32' ? : 0 1 1
8 1 ▶ if ($has_par) {
Branch: 1 branch
BranchTrueFalseTotal
if ($has_par) { } 1 0 1
9 1 plan tests => 20;
10 } else {
11 0 plan tests => 0; exit;
12 }
13 };
14 0 ▶use PAR::WebStart;
Subroutine BEGIN: called CC=1 SCAR=2.6
15 use PAR::WebStart::PNLP;
16 use Cwd;
17 require File::Spec;
18 my $cwd = getcwd;
19 my $file = File::Spec->catfile($cwd, 't', 'hello.pnlp');
20 ok(-e $file);
21 my $obj = PAR::WebStart->new(file => $file);
22 ok($obj->isa('PAR::WebStart'));
23 my $cfg = $obj->{cfg};
24 ok($cfg);
25 ok($cfg->{pnlp}->{spec}, '0.1');
26 ok($cfg->{pnlp}->{codebase}, 'http://localhost/perlwebstart/apps');
27 ok($cfg->{pnlp}->{href}, 'hello.pnlp');
28 ok($cfg->{information}->{seen}, 1);
29 ok($cfg->{title}->{value}, 'Hello App');
30 ok($cfg->{vendor}->{value}, 'Some Vendor');
31 ok($cfg->{homepage}->{href}, 'http://localhost/perlwebstart/demos.html');
32 ok($cfg->{description}->[0]->{value}, 'Hello Demo Description');
33 ok($cfg->{perlws}->{version}, '0.1');
34 ok($cfg->{'application-desc'}->{'main-par'}, 'A');
35
36 my $par_ref = $cfg->{par};
37 ok(scalar(@$par_ref), 2);
38 ok($par_ref->[0]->{href}, 'A.par');
39 ok($par_ref->[1]->{href}, 'C.par');
40
41 my $arg_ref = $cfg->{argument};
42 ok(scalar(@$arg_ref), 3);
43 ok($arg_ref->[0]->{value}, 'one');
44 ok($arg_ref->[1]->{value}, '-two');
45 ok($arg_ref->[2]->{value}, 'three');
« blib/script/make_par.pl ↑ Summary blib/lib/PAR/WebStart/PNLP.pm »