Page MenuHomePhabricator

Parser tests for alternative footnote numbering
Open, Needs TriagePublic3 Estimated Story Points

Description

There are several customizations available to Cite wikis, broken into sections here. We need tests for all of them.

The parser test DSL is surprisingly powerful, spec can be found in tests/parser/TestFileReader.php and examples in tests/parser/parserTests.txt. Some trickery might be required to set custom messages or otherwise influence the test. In the worst-case scenario, we can set a testing global which is picked up in Cite logic. One fine solution is to include an i18n message such as cite_link_label_group-testing with a few symbols. Any included message won't interfere with wikis where "testing" was already a custom group, since it will have lower priority than the customized message.

This parser testing is motivated by wanting to not break wikis where this is enabled. Slightly different logic and variables are used in this case, it's not an entirely trivial substitution.

New tests can be grouped into a new file under Cite/tests/parser.

Footnote mark by group

Special <ref group="..."> names select custom footnote marks, for example:
https://en.wikipedia.org/wiki/MediaWiki:Cite_link_label_group-lower-greek
https://en.wikipedia.org/wiki/Template:Efn/testcases#Group

This has some coverage already. Make sure it's crossed with any other features that might break it.

Example magic test glue:

!! article
MediaWiki:cite_link_label_group-klingon
!! text
wa'  cha' wej loS vagh jav Soch chorgh Hut wa'maH
!! endarticle

Footnote reuse

Footnote reuse numbering can be overridden by messages. Here's a high-profile override:
https://en.wikipedia.org/wiki/MediaWiki:Cite_references_link_many_format which cases this list to be used,
https://en.wikipedia.org/wiki/MediaWiki:Cite_references_link_many_format_backlink_labels