Skip to content

Commit 5cff681

Browse files
committed
Fix tests.
1 parent a44e25f commit 5cff681

4 files changed

Lines changed: 27 additions & 27 deletions

File tree

changelog/dmd.ddoc-behavior-flags.dd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Ddoc now emits behavior-flag badges for function guarantees
22

33
Documented functions now display badge-like $(I behavior flags) under their
44
title, similar to the build-status badges seen in project READMEs. When any are
5-
present, the badges are introduced by a `Behaviors:` label. Four flags are
5+
present, the badges are introduced by a `Current Behaviors:` label. Four flags are
66
available, each shown only when it applies and each in a distinct color:
77

88
$(UL
@@ -31,7 +31,7 @@ void* fastCopy(void* dst, const(void)* src, size_t n) @nogc nothrow pure;
3131

3232
The example above renders a $(I No Allocations) badge (written manually) next to
3333
the $(I No GC), $(I No Exceptions Thrown) and $(I Is Pure) badges (added
34-
automatically from the attributes), all shown after a `Behaviors:` label.
34+
automatically from the attributes), all shown after a `Current Behaviors:` label.
3535

3636
The badges and their grouping container are produced by the new `NOALLOC`,
3737
`NOGC`, `NOTHROW`, `PURE` and `DDOC_FLAGS` macros, which can be redefined like

compiler/test/compilable/extra-files/ddoc10.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ <h4>Declaration</h4>
582582
</section>
583583
</div>
584584
<div class="ddoc_decl">
585-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
585+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
586586

587587

588588
</div>
@@ -608,7 +608,7 @@ <h4>Declaration</h4>
608608
</section>
609609
</div>
610610
<div class="ddoc_decl">
611-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
611+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
612612

613613

614614
</div>

compiler/test/compilable/extra-files/ddoc14.html

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ <h4>Declaration</h4>
117117
</section>
118118
</div>
119119
<div class="ddoc_decl">
120-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
120+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
121121
<section class="section ddoc_sections">
122122
<div class="ddoc_summary">
123123
<p class="para">
@@ -150,7 +150,7 @@ <h4>Declaration</h4>
150150
</section>
151151
</div>
152152
<div class="ddoc_decl">
153-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
153+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
154154
<section class="section ddoc_sections">
155155
<div class="ddoc_summary">
156156
<p class="para">
@@ -183,7 +183,7 @@ <h4>Declaration</h4>
183183
</section>
184184
</div>
185185
<div class="ddoc_decl">
186-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
186+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
187187
<section class="section ddoc_sections">
188188
<div class="ddoc_summary">
189189
<p class="para">
@@ -216,7 +216,7 @@ <h4>Declaration</h4>
216216
</section>
217217
</div>
218218
<div class="ddoc_decl">
219-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
219+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
220220
<section class="section ddoc_sections">
221221
<div class="ddoc_summary">
222222
<p class="para">
@@ -249,7 +249,7 @@ <h4>Declaration</h4>
249249
</section>
250250
</div>
251251
<div class="ddoc_decl">
252-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
252+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
253253
<section class="section ddoc_sections">
254254
<div class="ddoc_summary">
255255
<p class="para">
@@ -282,7 +282,7 @@ <h4>Declaration</h4>
282282
</section>
283283
</div>
284284
<div class="ddoc_decl">
285-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
285+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
286286
<section class="section ddoc_sections">
287287
<div class="ddoc_summary">
288288
<p class="para">
@@ -315,7 +315,7 @@ <h4>Declaration</h4>
315315
</section>
316316
</div>
317317
<div class="ddoc_decl">
318-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
318+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
319319
<section class="section ddoc_sections">
320320
<div class="ddoc_summary">
321321
<p class="para">
@@ -447,7 +447,7 @@ <h4>Declaration</h4>
447447
</section>
448448
</div>
449449
<div class="ddoc_decl">
450-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
450+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
451451
<section class="section ddoc_sections">
452452
<div class="ddoc_summary">
453453
<p class="para">
@@ -480,7 +480,7 @@ <h4>Declaration</h4>
480480
</section>
481481
</div>
482482
<div class="ddoc_decl">
483-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
483+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
484484
<section class="section ddoc_sections">
485485
<div class="ddoc_summary">
486486
<p class="para">
@@ -513,7 +513,7 @@ <h4>Declaration</h4>
513513
</section>
514514
</div>
515515
<div class="ddoc_decl">
516-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
516+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
517517
<section class="section ddoc_sections">
518518
<div class="ddoc_summary">
519519
<p class="para">
@@ -546,7 +546,7 @@ <h4>Declaration</h4>
546546
</section>
547547
</div>
548548
<div class="ddoc_decl">
549-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
549+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
550550
<section class="section ddoc_sections">
551551
<div class="ddoc_summary">
552552
<p class="para">
@@ -579,7 +579,7 @@ <h4>Declaration</h4>
579579
</section>
580580
</div>
581581
<div class="ddoc_decl">
582-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
582+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
583583
<section class="section ddoc_sections">
584584
<div class="ddoc_summary">
585585
<p class="para">
@@ -612,7 +612,7 @@ <h4>Declaration</h4>
612612
</section>
613613
</div>
614614
<div class="ddoc_decl">
615-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
615+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
616616
<section class="section ddoc_sections">
617617
<div class="ddoc_summary">
618618
<p class="para">
@@ -645,7 +645,7 @@ <h4>Declaration</h4>
645645
</section>
646646
</div>
647647
<div class="ddoc_decl">
648-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
648+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
649649
<section class="section ddoc_sections">
650650
<div class="ddoc_summary">
651651
<p class="para">
@@ -747,7 +747,7 @@ <h4>Declaration</h4>
747747
</section>
748748
</div>
749749
<div class="ddoc_decl">
750-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
750+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
751751
<section class="section ddoc_sections">
752752
<div class="ddoc_summary">
753753
<p class="para">
@@ -780,7 +780,7 @@ <h4>Declaration</h4>
780780
</section>
781781
</div>
782782
<div class="ddoc_decl">
783-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
783+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
784784
<section class="section ddoc_sections">
785785
<div class="ddoc_summary">
786786
<p class="para">
@@ -813,7 +813,7 @@ <h4>Declaration</h4>
813813
</section>
814814
</div>
815815
<div class="ddoc_decl">
816-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
816+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
817817
<section class="section ddoc_sections">
818818
<div class="ddoc_summary">
819819
<p class="para">
@@ -846,7 +846,7 @@ <h4>Declaration</h4>
846846
</section>
847847
</div>
848848
<div class="ddoc_decl">
849-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
849+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
850850
<section class="section ddoc_sections">
851851
<div class="ddoc_summary">
852852
<p class="para">
@@ -879,7 +879,7 @@ <h4>Declaration</h4>
879879
</section>
880880
</div>
881881
<div class="ddoc_decl">
882-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
882+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
883883
<section class="section ddoc_sections">
884884
<div class="ddoc_summary">
885885
<p class="para">
@@ -912,7 +912,7 @@ <h4>Declaration</h4>
912912
</section>
913913
</div>
914914
<div class="ddoc_decl">
915-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
915+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
916916
<section class="section ddoc_sections">
917917
<div class="ddoc_summary">
918918
<p class="para">
@@ -945,7 +945,7 @@ <h4>Declaration</h4>
945945
</section>
946946
</div>
947947
<div class="ddoc_decl">
948-
<div class="ddoc_flags"><span class="ddoc_flags_label">Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
948+
<div class="ddoc_flags"><span class="ddoc_flags_label">Current Behaviors:</span><span class="ddoc_flag ddoc_flag_nothrow" title="Does not throw exceptions">No Exceptions Thrown</span><span class="ddoc_flag ddoc_flag_pure" title="Has no observable side effects">Is Pure</span></div>
949949
<section class="section ddoc_sections">
950950
<div class="ddoc_summary">
951951
<p class="para">

spec/ddoc.dd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ $(P
859859
Functions can advertise behavioral guarantees with badge-like $(I behavior flags)
860860
that are displayed under the declaration, similar to the build-status badges
861861
seen in project READMEs. When any are present, the badges are introduced by a
862-
$(D Behaviors:) label. Four flags are available: `$(DOLLAR)(NOALLOC)` (rendered
862+
$(D Current Behaviors:) label. Four flags are available: `$(DOLLAR)(NOALLOC)` (rendered
863863
$(I No Allocations)), `$(DOLLAR)(NOGC)` (rendered $(I No GC)),
864864
`$(DOLLAR)(NOTHROW)` (rendered $(I No Exceptions Thrown)) and `$(DOLLAR)(PURE)`
865865
(rendered $(I Is Pure)). Each flag is shown only when it applies, and each is
@@ -893,7 +893,7 @@ $(P
893893
The example above renders a $(I No Allocations) badge (written manually) next to
894894
the $(I No GC), $(I No Exceptions Thrown) and $(I Is Pure) badges (added
895895
automatically from the attributes), all shown under the function's title after a
896-
$(D Behaviors:) label.
896+
$(D Current Behaviors:) label.
897897
)
898898

899899
$(H3 $(LNAME2 character_entities, Character Entities))

0 commit comments

Comments
 (0)