ExtDirect/Test/Pkg/Meta.pm

filter: Statementstmt 100% 78 / 78 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 28 / 28 Podpod 0.0% 0 / 13 totaltotal 89.0% 106 / 119 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« ExtDirect/Test/Pkg/Qux.pm ↑ Summary ExtDirect/NoEvents.pm »
1 #
2 # WARNING WARNING WARNING
3 #
4 # DO NOT CHANGE ANYTHING IN THIS MODULE. OTHERWISE, A LOT OF API
5 # AND OTHER TESTS MAY BREAK.
6 #
7 # This module is here to test certain behaviors. If you need
8 # to test something else, add another test module.
9 # It's that simple.
10 #
11  
12 # This does not need to be indexed by PAUSE
13 package
14 RPC::ExtDirect::Test::Pkg::Meta;
15  
16 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 4 ▶use RPC::ExtDirect;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 sub arg0 : ExtDirect(0, metadata => { len => 2, arg => 0 }) {
22 2 ▶ my ($class, $meta) = @_;
Subroutine arg0: called CC=1 SCAR=0.0
Pod undocumented
23  
24 2 return { meta => $meta };
25 4 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
26  
27 sub arg1_last : ExtDirect(1, metadata => { len => 1, arg => 99, }) {
28 1 ▶ my ($class, $arg1, $meta) = @_;
Subroutine arg1_last: called CC=1 SCAR=0.0
Pod undocumented
29  
30 1 return { arg1 => $arg1, meta => $meta };
31 4 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
32  
33 sub arg1_first : ExtDirect(1, metadata => { len => 2, arg => 0 }) {
34 1 ▶ my ($class, $meta, $arg1) = @_;
Subroutine arg1_first: called CC=1 SCAR=0.0
Pod undocumented
35
36 1 return { arg1 => $arg1, meta => $meta };
37 4 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
38  
39 sub arg2_last : ExtDirect(2, metadata => { len => 1, arg => 99, }) {
40 1 ▶ my ($class, $arg1, $arg2, $meta) = @_;
Subroutine arg2_last: called CC=1 SCAR=0.0
Pod undocumented
41  
42 1 return { arg1 => $arg1, arg2 => $arg2, meta => $meta };
43 4 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
44  
45 sub arg2_middle : ExtDirect(2, metadata => { len => 2, arg => 1 }) {
46 1 ▶ my ($class, $arg1, $meta, $arg2) = @_;
Subroutine arg2_middle: called CC=1 SCAR=0.0
Pod undocumented
47  
48 1 return { arg1 => $arg1, arg2 => $arg2, meta => $meta };
49 4 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
50  
51 sub named_default : ExtDirect(params => [], metadata => { len => 1 }) {
52 1 ▶ my ($class, %arg) = @_;
Subroutine named_default: called CC=1 SCAR=0.0
Pod undocumented
53  
54 1 my $meta = delete $arg{metadata};
55  
56 1 return { %arg, meta => $meta };
57 4 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
58  
59 # One line declarations are intentional; Perls below 5.12 have trouble
60 # parsing attributes spanning multiple lines
61 sub named_arg : ExtDirect(params => [], metadata => { len => 1, arg => 'foo' }) {
62 3 ▶ my ($class, %arg) = @_;
Subroutine named_arg: called CC=1 SCAR=0.0
Pod undocumented
63  
64 3 my $meta = delete $arg{foo};
65  
66 3 return { %arg, meta => $meta };
67 4 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
68  
69 sub named_strict : ExtDirect(params => [], metadata => { params => ['foo'] }) {
70 1 ▶ my ($class, %arg) = @_;
Subroutine named_strict: called CC=1 SCAR=0.0
Pod undocumented
71
72 1 my $meta = delete $arg{metadata};
73  
74 1 return { %arg, meta => $meta };
75 4 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
76  
77 sub named_unstrict : ExtDirect(params => [], metadata => { params => [], strict => !1, arg => '_meta' }) {
78 1 ▶ my ($class, %arg) = @_;
Subroutine named_unstrict: called CC=1 SCAR=0.0
Pod undocumented
79  
80 1 my $meta = delete $arg{_meta};
81  
82 1 return { %arg, meta => $meta };
83 4 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
84  
85 sub form_ordered : ExtDirect(formHandler, metadata => { len => 1 }) {
86 1 ▶ my ($class, %arg) = @_;
Subroutine form_ordered: called CC=1 SCAR=0.0
Pod undocumented
87
88 1 return { %arg };
89 4 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
90  
91 sub form_named : ExtDirect(formHandler, metadata => { arg => '_m', strict => !1, }) {
92 1 ▶ my ($class, %arg) = @_;
Subroutine form_named: called CC=1 SCAR=0.0
Pod undocumented
93
94 1 return { %arg };
95 4 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
96  
97 sub aux_hook {
98 1 ▶ my ($class, %arg) = @_;
Subroutine aux_hook: called CC=1 SCAR=0.0
Pod undocumented
99
100 1 my $method_arg = $arg{arg};
101
102 1 push @$method_arg, $arg{aux_data};
103
104 1 return 1;
105 }
106  
107 sub aux : ExtDirect(0, before => \&aux_hook) {
108 1 ▶ my ($class, $aux) = @_;
Subroutine aux: called CC=1 SCAR=0.0
Pod undocumented
109
110 1 return { aux => $aux };
111 4 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
112  
113 4 1;
« ExtDirect/Test/Pkg/Qux.pm ↑ Summary ExtDirect/NoEvents.pm »