Resolve a TODO by covering it with a test case

It turns out this is indeed necessary. The test demonstrates why.

Change-Id: Id9c6a48f72ef8d3f0cc9a714d826418e69913b0a
This commit is contained in:
Thiemo Kreuz 2020-01-20 21:11:54 +01:00 committed by Awight
parent e343af3408
commit 9565d6e887
2 changed files with 22 additions and 2 deletions

View file

@ -343,8 +343,7 @@ class ReferenceStack {
case 'new':
// Rollback the addition of new elements to the stack
unset( $this->refs[$group][$lookup] );
if ( $this->refs[$group] === [] ) {
// TODO: Unsetting is unecessary.
if ( !$this->refs[$group] ) {
$this->popGroup( $group );
}
// TODO: else, don't we need to decrement groupRefSequence?

View file

@ -2037,6 +2037,27 @@ T242437 - Blank ref name in #tag regression
</p>
!! end
!! test
Numbers in the default group need to start with 1, independent from other groups
!! wikitext
<ref name="a" group="g" />
{{#tag:references|
<ref name="a">a</ref>
|group=g}}
<ref name="c">c</ref>
!! html
<p><sup id="cite_ref-a_1-0" class="reference"><a href="#cite_note-a-1">&#91;g 1&#93;</a></sup>
</p>
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-a-1"><span class="mw-cite-backlink"><a href="#cite_ref-a_1-0">↑</a></span> <span class="reference-text">a</span>
</li>
</ol></div>
<sup id="cite_ref-c_3-0" class="reference"><a href="#cite_note-c-3">&#91;1&#93;</a></sup><div class="mw-references-wrap"><ol class="references">
<li id="cite_note-c-3"><span class="mw-cite-backlink"><a href="#cite_ref-c_3-0">↑</a></span> <span class="reference-text">c</span>
</li>
</ol></div>
!! end
!! test
Serialize reference tags by themselves on a line
!! options