blob: 5b0391c9bfad86a40b8b954b0e120a3e8a27bc3c (
plain)
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
|
use strict;
use warnings;
use Test::More;
use Devel::StackTrace;
sub foo {
return Devel::StackTrace->new(@_);
}
sub make_dst {
foo(@_);
}
{
my $dst = make_dst();
for my $line ( split /\n/, $dst->as_string() ) {
unlike( $line, qr/^\s/, 'line does not start with whitespace' );
}
}
{
my $dst = make_dst( indent => 1 );
my @lines = split /\n/, $dst->as_string();
shift @lines;
for my $line (@lines) {
like( $line, qr/^\s/, 'line starts with whitespace' );
}
}
done_testing();
|