Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1979 from tbrowder/input-output
Fix GH #1968: input/output block lines are squeezed
- Loading branch information
Showing
3 changed files
with
276 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
use v6.c; | ||
use Test; | ||
|
||
use Pod::To::Text; | ||
|
||
plan 18; | ||
|
||
my $r; | ||
my $rp; | ||
my $p = -1; | ||
|
||
# explicit code blocks | ||
{ | ||
=begin code | ||
say 1; | ||
say 2; | ||
=end code | ||
$r = $=pod[++$p]; | ||
isa-ok $r, Pod::Block::Code; | ||
# code blocks should get indented 4 spaces by Pod::To::Text | ||
$rp = Pod::To::Text.render($r), | ||
is $rp, | ||
q:to/END/; | ||
say 1; | ||
say 2; | ||
END | ||
|
||
=code | ||
say 1; | ||
say 2; | ||
|
||
$r = $=pod[++$p]; | ||
isa-ok $r, Pod::Block::Code; | ||
# code blocks should get indented 4 spaces by Pod::To::Text | ||
$rp = Pod::To::Text.render($r), | ||
is $rp, | ||
q:to/END/; | ||
say 1; | ||
say 2; | ||
END | ||
|
||
=for code | ||
say 1; | ||
say 2; | ||
$r = $=pod[++$p]; | ||
isa-ok $r, Pod::Block::Code; | ||
# code blocks should get indented 4 spaces by Pod::To::Text | ||
$rp = Pod::To::Text.render($r), | ||
is $rp, | ||
q:to/END/; | ||
say 1; | ||
say 2; | ||
END | ||
} | ||
|
||
# implicit code blocks: input | ||
{ | ||
=begin input | ||
say 1; | ||
say 2; | ||
=end input | ||
$r = $=pod[++$p]; | ||
isa-ok $r, Pod::Block::Code; | ||
# code blocks should get indented 4 spaces by Pod::To::Text | ||
$rp = Pod::To::Text.render($r), | ||
is $rp, | ||
q:to/END/; | ||
say 1; | ||
say 2; | ||
END | ||
|
||
=input | ||
say 1; | ||
say 2; | ||
|
||
$r = $=pod[++$p]; | ||
isa-ok $r, Pod::Block::Code; | ||
# code blocks should get indented 4 spaces by Pod::To::Text | ||
$rp = Pod::To::Text.render($r), | ||
is $rp, | ||
q:to/END/; | ||
say 1; | ||
say 2; | ||
END | ||
|
||
=for input | ||
say 1; | ||
say 2; | ||
$r = $=pod[++$p]; | ||
isa-ok $r, Pod::Block::Code; | ||
# code blocks should get indented 4 spaces by Pod::To::Text | ||
$rp = Pod::To::Text.render($r), | ||
is $rp, | ||
q:to/END/; | ||
say 1; | ||
say 2; | ||
END | ||
} | ||
|
||
# implicit code blocks: output | ||
{ | ||
=begin output | ||
say 1; | ||
say 2; | ||
=end output | ||
$r = $=pod[++$p]; | ||
isa-ok $r, Pod::Block::Code; | ||
# code blocks should get indented 4 spaces by Pod::To::Text | ||
$rp = Pod::To::Text.render($r), | ||
is $rp, | ||
q:to/END/; | ||
say 1; | ||
say 2; | ||
END | ||
|
||
=output | ||
say 1; | ||
say 2; | ||
|
||
$r = $=pod[++$p]; | ||
isa-ok $r, Pod::Block::Code; | ||
# code blocks should get indented 4 spaces by Pod::To::Text | ||
$rp = Pod::To::Text.render($r), | ||
is $rp, | ||
q:to/END/; | ||
say 1; | ||
say 2; | ||
END | ||
|
||
=for output | ||
say 1; | ||
say 2; | ||
$r = $=pod[++$p]; | ||
isa-ok $r, Pod::Block::Code; | ||
# code blocks should get indented 4 spaces by Pod::To::Text | ||
$rp = Pod::To::Text.render($r), | ||
is $rp, | ||
q:to/END/; | ||
say 1; | ||
say 2; | ||
END | ||
} | ||
|
||
# vim: expandtab shiftwidth=4 ft=perl6 |