line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
12
|
|
|
12
|
|
168
|
use v5.14; |
|
12
|
|
|
|
|
47
|
|
2
|
12
|
|
|
12
|
|
65
|
use warnings; |
|
12
|
|
|
|
|
29
|
|
|
12
|
|
|
|
|
2560
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Test::BDD::Cucumber::Util 0.85; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Test::BDD::Cucumber::Util - Some functions used throughout the code |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
version 0.85 |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Some functions used throughout the code |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 FUNCTIONS |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head2 bs_quote |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head2 bs_unquote |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
C "makes safe" strings with backslashed characters in it, so other |
26
|
|
|
|
|
|
|
operations can be done on them. C goes the other way. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
$string = "foo \ "; |
29
|
|
|
|
|
|
|
$string = bs_quote( $string ); |
30
|
|
|
|
|
|
|
$string =~ s/<([^>]+)>/"$1"/g; |
31
|
|
|
|
|
|
|
$string = bs_unquote( $string ); |
32
|
|
|
|
|
|
|
$string eq 'foo "baz"'; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=cut |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
my $marker_start = ';;;TEST_BDD_TEMP_MARKER_OPEN;;;'; |
37
|
|
|
|
|
|
|
my $marker_end = ';;;TEST_BDD_TEMP_MARKER_END;;;'; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub bs_quote { |
40
|
496
|
|
|
496
|
1
|
956
|
my $string = shift; |
41
|
496
|
|
|
|
|
1202
|
$string =~ s/\\(.)/${marker_start} . ord($1) . ${marker_end}/ge; |
|
0
|
|
|
|
|
0
|
|
42
|
496
|
|
|
|
|
1188
|
return $string; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub bs_unquote { |
46
|
496
|
|
|
496
|
1
|
901
|
my $string = shift; |
47
|
496
|
|
|
|
|
2208
|
$string =~ s/$marker_start(\d+)$marker_end/chr($1)/ge; |
|
0
|
|
|
|
|
0
|
|
48
|
496
|
|
|
|
|
1525
|
return $string; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 AUTHOR |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Peter Sergeant C |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 LICENSE |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Copyright 2019-2023, Erik Huelsmann |
58
|
|
|
|
|
|
|
Copyright 2011-2019, Peter Sergeant; Licensed under the same terms as Perl |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=cut |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |