Skip to content

Commit f64e981

Browse files
committed
add new pod tests
+ test for robust =end for blocks even though misaligned with its =begin + test to show current state of failure with nested comment blocks that shows parsing of code ends at the first =end comment OR an error is thrown in other circumstances
1 parent a76455f commit f64e981

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

t/nqp/005-comments.t

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# check comments
44

5-
say('1..8');
5+
say('1..16');
66

77
#Comment preceding
88
say("ok 1");
@@ -54,4 +54,44 @@ say("ok 7");
5454

5555
say("ok 8");
5656

57+
=begin comment
58+
this is indented pod with an unaligned =end comment
59+
=end comment
60+
say("ok 9");
5761

62+
63+
=begin comment
64+
this is another indented pod with an unaligned =end comment
65+
=end comment
66+
say("ok 10");
67+
68+
# Parsing breaks down here: no errors are found
69+
# with the second =end and how it's interpreted.
70+
# seems to be a pod object of unknown type.
71+
# the second =begin seems to be ignored or
72+
# considered part of the comment.
73+
# may need a :nested config key
74+
=begin comment
75+
this is indented pod with an unaligned =end comment
76+
=begin comment
77+
this is a nested comment
78+
=end comment
79+
say("ok 11");
80+
81+
say("ok 12");
82+
# the following doesn't trigger a panic:
83+
=end comment
84+
85+
say("ok 13");
86+
87+
88+
=begin comment
89+
this is indented pod with an unaligned =end comment
90+
=begin comment
91+
this is a nested comment
92+
=end comment
93+
say("ok 14");
94+
say("ok 15");
95+
# the following triggers a panic if uncommented:
96+
#=end comment
97+
say("ok 16");

0 commit comments

Comments
 (0)