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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
|
# vim: set ts=2 sts=2 sw=2 expandtab smarttab:
use strict;
use warnings;
use lib 't/lib';
use MarkdownTests tests => 1;
my $parser = Pod::Markdown->new;
$parser->output_string(\my $markdown);
$parser->parse_file(\*DATA);
my $expect = <<'EOMARKDOWN';
# SYNOPSIS
# 4 spaces
# should come out the same
# TABS
These tabs
will be expanded.
# 3 SPACES
3 spaces should be converted to 4.
Here, too
And also
here.
# MIXED (You don't really want to do that, though, do you?)
Mixed paragraphs should all get the same indentation added
to preserve the formatting:
4 spaces (+ 2 = 6)
a tab
3 spaces (+ 2 = 5)
2 spaces (+ 2 = 4) (the minimum)
# 5 spaces
Because you can
if you want to
# 1 space
a little short, but valid
# indented blank lines
one
two
three
four
# nonindented blank lines
one
two
three
four
# THAT'S ENOUGH
EOMARKDOWN
eq_or_diff $markdown, $expect,
'preserve verbatim paragraphs of various initial whitespace combinations';
__DATA__
=head1 SYNOPSIS
# 4 spaces
# should come out the same
=head1 TABS
These tabs
will be expanded.
=head1 3 SPACES
3 spaces should be converted to 4.
Here, too
And also
here.
=head1 MIXED (You don't really want to do that, though, do you?)
Mixed paragraphs should all get the same indentation added
to preserve the formatting:
4 spaces (+ 2 = 6)
a tab
3 spaces (+ 2 = 5)
2 spaces (+ 2 = 4) (the minimum)
=head1 5 spaces
Because you can
if you want to
=head1 1 space
a little short, but valid
=head1 indented blank lines
one
two
three
four
=head1 nonindented blank lines
one
two
three
four
=head1 THAT'S ENOUGH
=cut
|