From 5db90fb5a96897150982f9928a113dd7683d709f Mon Sep 17 00:00:00 2001 From: Thiemo Kreuz Date: Tue, 7 Jan 2020 12:43:18 +0100 Subject: [PATCH] Test cases for extends pointing to the section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is an extremely relevant use case, but we never had a test for this: Some text.Page 2 Title of the book What this means: There is no reference in the text that points to the book as a whole, only references that point to individual pages. The base is not used in the text. This is already properly rendered. There is no "jump back to the text" link. However, this fails when is wrapped in {{#tag:…}}. Bug: T239810 Change-Id: Id22db0238266a4fd6131d1a10eb6bf6227552c19 --- tests/parser/bookReferencing.txt | 48 ++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/tests/parser/bookReferencing.txt b/tests/parser/bookReferencing.txt index f075cf88b..5fd7912c1 100644 --- a/tests/parser/bookReferencing.txt +++ b/tests/parser/bookReferencing.txt @@ -486,8 +486,7 @@ wgCiteBookReferencing=true !! end -# TODO: -# * Should render an error at the third reference. +# TODO: Should render an error at the third reference. !! test T236256 - Dont allow splitting a book reference for now !! config @@ -551,8 +550,48 @@ invalid names, e.g. too many !! end -# TODO -# * This should be invalid, there's no way to know that `footwo` should be subnumbered in a one-pass parse. +!! test +Extending a that doesn't appear in the text, but in +!! config +wgCiteBookReferencing=true +!! wikitext +Page 2 + +Book + +!! html +

[1.1] +

+
    +
  1. Book +
    1. Page 2 +
    2. +
  2. +
+!! end + +# TODO: Should behave the same as above! +!! test +T239810: Extending a that doesn't appear in the text, but in {{#tag:references}} +!! config +wgCiteBookReferencing=true +!! wikitext +Page 2 +{{#tag:references| +Book +}} +!! html +

[1.1] +

+
    +
    1. Page 2 +
    2. +
+

Cite error: <ref> tag with name "a" defined in <references> is not used in prior text. +

+!! end + +# TODO: This should be invalid, there's no way to know that `footwo` should be subnumbered in a one-pass parse. !! test Extends defined in called with #tag !! config @@ -560,7 +599,6 @@ wgCiteBookReferencing=true !! wikitext BAR - {{#tag:references| p. 10 }}