Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Move comment-related tests to a separate file
  • Loading branch information
Tadeusz Sośnierz committed Jun 14, 2011
1 parent fefcd4e commit 4a1e0ad
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 67 deletions.
69 changes: 2 additions & 67 deletions t/05-code-comment.t → t/05-code.t
@@ -1,73 +1,8 @@
use Test;
use Pod6;
plan 65;

my $x = q[
=begin comment
foo foo
=begin invalid pod
=as many invalid pod as we want
===yay!
=end comment
];

my $r = Pod6::parse($x);
isa_ok $r, Pod6::Block;
is $r.content.elems, 1;
is $r.content[0], "foo foo\n=begin invalid pod\n"
~ "=as many invalid pod as we want\n===yay!\n";

$x = q[
=for comment
foo foo
bla bla bla
This isn't a comment
];

$r = Pod6::parse($x);
isa_ok $r, Pod6::Block::Comment;
is $r.content.elems, 1;
is $r.content[0], "foo foo\nbla bla bla\n";

$x = q[
=comment foo foo
bla bla bla
This isn't a comment
];

$r = Pod6::parse($x);
isa_ok $r, Pod6::Block::Comment;
is $r.content.elems, 1;
is $r.content[0], "foo foo\nbla bla bla\n";
plan 50;

# just checking if Code works too
$x = q[
=begin pod
=code foo foo
bla bla bla
This isn't a comment
=end pod
];

$r = Pod6::parse($x);
isa_ok $r.content[0], Pod6::Block::Code;
is $r.content[0].elems, 1;
is $r.content[0].content, "foo foo\nbla bla bla\n";

# from S26
$x = q[
=comment
This file is deliberately specified in Perl 6 Pod format
];

$r = Pod6::parse($x);
isa_ok $r, Pod6::Block::Comment;
is $r.content.elems, 1;
is $r.content[0],
"This file is deliberately specified in Perl 6 Pod format\n";
my ($x, $r);

$x = q[
=begin pod
Expand Down
72 changes: 72 additions & 0 deletions t/07-comment.t
@@ -0,0 +1,72 @@
use Pod6;
use Test;
plan 15;

my ($x, $r);

$x = q[
=begin comment
foo foo
=begin invalid pod
=as many invalid pod as we want
===yay!
=end comment
];

$r = Pod6::parse($x);
isa_ok $r, Pod6::Block;
is $r.content.elems, 1;
is $r.content[0], "foo foo\n=begin invalid pod\n"
~ "=as many invalid pod as we want\n===yay!\n";

$x = q[
=for comment
foo foo
bla bla bla
This isn't a comment
];

$r = Pod6::parse($x);
isa_ok $r, Pod6::Block::Comment;
is $r.content.elems, 1;
is $r.content[0], "foo foo\nbla bla bla\n";

$x = q[
=comment foo foo
bla bla bla
This isn't a comment
];

$r = Pod6::parse($x);
isa_ok $r, Pod6::Block::Comment;
is $r.content.elems, 1;
is $r.content[0], "foo foo\nbla bla bla\n";

# just checking if Code works too
$x = q[
=begin pod
=code foo foo
bla bla bla
This isn't a comment
=end pod
];

$r = Pod6::parse($x);
isa_ok $r.content[0], Pod6::Block::Code;
is $r.content[0].elems, 1;
is $r.content[0].content, "foo foo\nbla bla bla\n";

# from S26
$x = q[
=comment
This file is deliberately specified in Perl 6 Pod format
];

$r = Pod6::parse($x);
isa_ok $r, Pod6::Block::Comment;
is $r.content.elems, 1;
is $r.content[0],
"This file is deliberately specified in Perl 6 Pod format\n";

0 comments on commit 4a1e0ad

Please sign in to comment.