- Notifications
You must be signed in to change notification settings - Fork 135
/
Copy path06-lists.t
106 lines (87 loc) · 2.38 KB
/
06-lists.t
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
useTest;
plan39;
my$r;
=beginpod
The seven suspects are:
=itemHappy
=itemDopey
=itemSleepy
=itemBashful
=itemSneezy
=itemGrumpy
=itemKeyser Soze
=endpod
$r=$=pod[0];
is$r.contents.elems, 8;
for1..7 {
isa-ok$r.contents[$_], Pod::Item;
}
is$r.contents[1].contents[0].contents, 'Happy', 'contents is happy :)';
is$r.contents[2].contents[0].contents, 'Dopey';
is$r.contents[7].contents[0].contents, 'Keyser Soze';
ok$r.contents[4].level.defined, '=item is an abbreviation of =item1';
=beginpod
=item1Animal
=item2Vertebrate
=item2Invertebrate
=item1Phase
=item2Solid
=item2Liquid
=item2Gas
=item2Chocolate
=endpod
$r=$=pod[1];
is$r.contents.elems, 8;
for0..7 {
isa-ok$r.contents[$_], Pod::Item;
}
is$r.contents[0].contents[0].contents, 'Animal';
is$r.contents[0].level, 1;
is$r.contents[2].contents[0].contents, 'Invertebrate';
is$r.contents[2].level, 2;
is$r.contents[3].contents[0].contents, 'Phase';
is$r.contents[3].level, 1;
is$r.contents[4].contents[0].contents, 'Solid';
is$r.contents[4].level, 2;
=beginpod
=commentCORRECT...
=beginitem1
The choices are:
=enditem1
=item2Liberty
=item2Death
=item2Beer
=endpod
$r=$=pod[2];
is$r.contents.elems, 5;
for1..4 {
isa-ok$r.contents[$_], Pod::Item;
}
# XXX Those items are :numbered in S26, but we're waiting with block
# configuration until we're inside Rakudo, otherwise we'll have to
# pretty much implement Pair parsing in gsocmess only to get rid of
# it later.
=beginpod
Let's consider two common proverbs:
=beginitem
I<The rain in Spain falls mainly on the plain.>
This is a common myth and an unconscionable slur on the Spanish
people, the majority of whom are extremely attractive.
=enditem
=beginitem
I<The early bird gets the worm.>
In deciding whether to become an early riser, it is worth
considering whether you would actually enjoy annelids
for breakfast.
=enditem
As you can see, folk wisdom is often of dubious value.
=endpod
$r=$=pod[3];
is$r.contents.elems, 4;
is$r.contents[0].contents, "Let's consider two common proverbs:";
ok$r.contents[1].contents[1].contents
~~ /:s This is a common .+ are extremely attractive/;
ok$r.contents[2].contents[1].contents
~~ /:s In deciding .+ annelids for breakfast/;
is$r.contents[3].contents, "As you can see, folk wisdom is often of dubious value.";
# vim: expandtab shiftwidth=4