-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path005-percent_p.t
66 lines (48 loc) · 891 Bytes
/
005-percent_p.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!perl
use strict;
use warnings;
use Test::More;
use Stacktrace::Configurable;
use t005_l2;
my $trace = Stacktrace::Configurable->new;
my $res;
my $l1_line = __LINE__;
sub l1 {$res = $trace->get_trace->as_string}
delete $ENV{STACKTRACE_CONFIG};
{
$trace->format='y%px';
t005_l2::l2; my $ln=__LINE__;
my $exp=<<'EOF'; chomp $exp;
yt005_l2x
ymainx
EOF
is $res, $exp, '%p';
}
{
$trace->format='y%3px';
t005_l2::l2; my $ln=__LINE__;
my $exp=<<'EOF'; chomp $exp;
yt00...x
ymai...x
EOF
is $res, $exp, '%3p';
}
{
$trace->format='y%-3px';
t005_l2::l2; my $ln=__LINE__;
my $exp=<<'EOF'; chomp $exp;
y..._l2x
y...ainx
EOF
is $res, $exp, '%-3ps';
}
{
$trace->format='y%[skip_prefix=t]px';
t005_l2::l2; my $ln=__LINE__;
my $exp=<<'EOF'; chomp $exp;
y005_l2x
ymainx
EOF
is $res, $exp, '%[skip_prefix=t]p';
}
done_testing;