Skip to content

Commit aeb52e4

Browse files
committed
Test that you can declaratively document Block objects
1 parent 4587519 commit aeb52e4

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

S26-documentation/why-both.t

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use Test;
2-
plan 284;
2+
plan 291;
33

44
my $pod_index = 0;
55

@@ -302,4 +302,11 @@ sub has-where(Int $n where * > 10) {}
302302

303303
test-both(&has-where, "where constraints shouldn't", 'prevent declarative comments');
304304

305+
#| this is
306+
my $block = {;
307+
};
308+
#= a block
309+
310+
test-both($block, 'this is', 'a block');
311+
305312
is $=pod.elems, $pod_index;

S26-documentation/why-leading.t

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use Test;
2-
plan 348;
2+
plan 355;
33

44
my $pod_index = 0;
55

@@ -315,4 +315,10 @@ sub has-where(Int $n where * > 10) {}
315315

316316
test-leading(&has-where, "where constraints shouldn't prevent declarative comments");
317317

318+
#| this is a block
319+
my $block = {;
320+
};
321+
322+
test-leading($block, 'this is a block');
323+
318324
is $=pod.elems, $pod_index;

S26-documentation/why-trailing.t

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use Test;
2-
plan 341;
2+
plan 348;
33

44
my $pod_index = 0;
55

@@ -306,4 +306,10 @@ sub has-where(Int $n where * > 10) {}
306306

307307
test-trailing(&has-where, "where constraints shouldn't prevent declarative comments");
308308

309+
my $block = {;
310+
};
311+
#= this is a block
312+
313+
test-trailing($block, 'this is a block');
314+
309315
is $=pod.elems, $pod_index;

0 commit comments

Comments
 (0)