diff options
Diffstat (limited to 't/04-indent.t')
-rw-r--r-- | t/04-indent.t | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/t/04-indent.t b/t/04-indent.t new file mode 100644 index 0000000..5b0391c --- /dev/null +++ b/t/04-indent.t @@ -0,0 +1,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(); |