Skip to content

Commit

Permalink
test: Add RFC 10k test (ietf-tools#1180)
Browse files Browse the repository at this point in the history
  • Loading branch information
kesara authored Oct 23, 2024
1 parent dce083d commit c8f9b7f
Show file tree
Hide file tree
Showing 29 changed files with 4,296 additions and 137 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ libversion_regex = \(pyflakes\|PyYAML\|requests\|setuptools\|six\|Weasyprint\) [

rfcxml= \
rfc7911.xml \
# rfc6787.xml \
# rfc7754.edited.xml \
rfc99999.xml \

rfcxmlfiles = $(addprefix tests/input/, $(rfcxml))
rfctxt = $(addsuffix .txt, $(basename $(rfcxml)))
Expand Down
52 changes: 52 additions & 0 deletions tests/input/rfc99999.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc [
<!ENTITY nbsp "&#160;">
<!ENTITY zwsp "&#8203;">
<!ENTITY nbhy "&#8209;">
<!ENTITY wj "&#8288;">
]>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" docName="draft-doe-fake-00" number="99999" submissionType="IETF" category="bcp" consensus="true" ipr="trust200902" obsoletes="" updates="" xml:lang="en" tocInclude="true" tocDepth="4" symRefs="true" sortRefs="true" version="3">
<front>
<title abbrev="Fake RFC">Fake RFC</title>
<seriesInfo name="RFC" value="99999"/>
<author initials="J." surname="Doe" fullname="Jane Doe">
<address>
<postal>
<country>NZ</country>
</postal>
<email>[email protected]</email>
</address>
</author>
<date year="2024" month="October"/>
<area>General</area>
<abstract>
<t>This is not a real RFC.</t>
</abstract>
</front>
<middle>
<section numbered="true" toc="default">
<name>Section 31</name>
<t>redacted <xref target="RFC99998"/></t>
</section>
</middle>
<back>
<references>
<name>References</name>
<references>
<name>Normative References</name>
<reference anchor="RFC99998" target="https://www.rfc-editor.org/info/rfc99998">
<front>
<title>Prime Directive</title>
<author fullname="J. Doe" initials="J." surname="Doe"/>
<date month="October" year="2024"/>
<abstract>
<t>Fake reference</t>
</abstract>
</front>
<seriesInfo name="RFC" value="99998"/>
<seriesInfo name="DOI" value="10.17487/RFC99998"/>
</reference>
</references>
</references>
</back>
</rfc>
16 changes: 8 additions & 8 deletions tests/valid/docfile.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<meta charset="utf-8">
<meta content="Cherokee,Common,Greek,Latin" name="scripts">
<meta content="initial-scale=1.0" name="viewport">
<title>Xml2rfc Vocabulary Version 3 Schema xml2rfc release 3.23.1</title>
<title>Xml2rfc Vocabulary Version 3 Schema xml2rfc release 3.23.2</title>
<meta content="xml2rfc(1)" name="author">
<meta content="
This document provides information about the XML schema implemented in this release of xml2rfc, and the individual elements of that schema. The document is generated from the RNG schema file that is part of the xml2rfc distribution, so schema information in this document should always be in sync with the schema in actual use. The textual descriptions depend on manual updates in order to reflect the implementation.
" name="description">
<meta content="xml2rfc 3.23.1" name="generator">
<meta content="xml2rfc-docs-3.23.1" name="ietf.draft">
<meta content="xml2rfc 3.23.2" name="generator">
<meta content="xml2rfc-docs-3.23.2" name="ietf.draft">
<link href="tests/out/docfile.xml" rel="alternate" type="application/rfc+xml">
<link href="#copyright" rel="license">
<link href="xml2rfc.css" rel="stylesheet">
Expand All @@ -24,7 +24,7 @@
<thead><tr>
<td class="left"></td>
<td class="center">Xml2rfc Vocabulary V3 Schema</td>
<td class="right">September 2024</td>
<td class="right">October 2024</td>
</tr></thead>
<tfoot><tr>
<td class="left">xml2rfc(1)</td>
Expand All @@ -39,7 +39,7 @@
<dd class="workgroup">xml2rfc(1)</dd>
<dt class="label-published">Published:</dt>
<dd class="published">
<time datetime="2024-09-20" class="published">20 September 2024</time>
<time datetime="2024-10-22" class="published">22 October 2024</time>
</dd>
<dt class="label-authors">Author:</dt>
<dd class="authors">
Expand All @@ -49,7 +49,7 @@
</dd>
</dl>
</div>
<h1 id="title">Xml2rfc Vocabulary Version 3 Schema<br>xml2rfc release 3.23.1</h1>
<h1 id="title">Xml2rfc Vocabulary Version 3 Schema<br>xml2rfc release 3.23.2</h1>
<section id="section-abstract">
<h2 id="abstract"><a href="#abstract" class="selfRef">Abstract</a></h2>
<p id="section-abstract-1">
Expand Down Expand Up @@ -371,7 +371,7 @@ <h2 id="name-introduction">
<p id="section-1-5">
The latest version of this documentation is available in HTML form at <span><a href="https://ietf-tools.github.io/xml2rfc/">https://ietf-tools.github.io/xml2rfc/</a></span>.<a href="#section-1-5" class="pilcrow"></a></p>
<p id="section-1-6">
This documentation applies to xml2rfc version 3.23.1.<a href="#section-1-6" class="pilcrow"></a></p>
This documentation applies to xml2rfc version 3.23.2.<a href="#section-1-6" class="pilcrow"></a></p>
</section>
<section id="section-2">
<h2 id="name-schema-version-3-elements">
Expand Down Expand Up @@ -6387,7 +6387,7 @@ <h2 id="name-xml2rfc-documentation-templ">
<p id="appendix-D-1">

The following variables are available for use in an xml2rfc
manpage Jinja2 template, as of xml2rfc version 3.23.1:<a href="#appendix-D-1" class="pilcrow"></a></p>
manpage Jinja2 template, as of xml2rfc version 3.23.2:<a href="#appendix-D-1" class="pilcrow"></a></p>
<span class="break"></span><dl class="dlNewline" id="appendix-D-2">
<dt id="appendix-D-2.1">{{ bare_latin_tags }}:</dt>
<dd style="margin-left: 1.5em" id="appendix-D-2.2"></dd>
Expand Down
10 changes: 5 additions & 5 deletions tests/valid/draft-miek-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
This version is adapted to work with "xml2rfc" version 2.x.
' name="description">
<meta content="xml2rfc 3.23.1" name="generator">
<meta content="xml2rfc 3.23.2" name="generator">
<meta content="RFC" name="keyword">
<meta content="Request for Comments" name="keyword">
<meta content="I-D" name="keyword">
Expand All @@ -26,19 +26,19 @@
<meta content="Extensible Markup Language" name="keyword">
<meta content="draft-gieben-writing-rfcs-pandoc-02" name="ietf.draft">
<!-- Generator version information:
xml2rfc 3.23.1
Python 3.12.4
xml2rfc 3.23.2
Python 3.12.7
ConfigArgParse 1.7
google-i18n-address 3.1.1
intervaltree 3.1.0
Jinja2 3.1.4
lxml 4.9.4
lxml 5.3.0
platformdirs 4.3.6
pycountry 24.6.1
pydyf 0.9.0
PyYAML 6.0.2
requests 2.32.3
setuptools 75.1.0
setuptools 75.2.0
wcwidth 0.2.13
weasyprint 61.2
-->
Expand Down
38 changes: 18 additions & 20 deletions tests/valid/draft-miek-test.v3add-xinclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -875,16 +875,14 @@ draft-gieben-writing-rfcs-pandoc-00.txt -> draft.txt
<!-- bibxml reference -->
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4941.xml"/><!-- bibxml-misc reference -->
<reference anchor="ISO.8327.1990" xml:base="https://bib.ietf.org/public/rfc/bibxml-misc/reference.ISO.8327.1990.xml">
<front>
<title>Information processing systems - Open Systems Interconnection - Basic connection oriented session protocol specification</title>
<author>
<organization>International Organization for Standardization</organization>
</author>
<date month="April" year="1990"/>
</front>

<seriesInfo name="ISO" value="Standard 8327"/>

<front>
<title>Information processing systems - Open Systems Interconnection - Basic connection oriented session protocol specification</title>
<author>
<organization>International Organization for Standardization</organization>
</author>
<date month="April" year="1990"/>
</front>
<seriesInfo name="ISO" value="Standard 8327"/>
</reference><!-- bibxml-ids reference -->
<xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-6lo-ap-nd.xml"/><!-- bibxml-w3c reference -->
<reference anchor="W3C.CR-accelerometer-20191212" target="https://www.w3.org/TR/2019/CR-accelerometer-20191212/" xml:base="https://bib.ietf.org/public/rfc/bibxml-misc/reference.W3C.CR-accelerometer-20191212.xml">
Expand All @@ -897,16 +895,16 @@ draft-gieben-writing-rfcs-pandoc-00.txt -> draft.txt
<seriesInfo name="W3C" value="CR-accelerometer-20191212"/>
</reference><!-- bibxml-ieee reference -->
<reference anchor="IEEE.802-1Y.1990" xml:base="https://bib.ietf.org/public/rfc/bibxml-misc/reference.IEEE.802-1Y.1990.xml">
<front>
<title>Source Routing Tutorial for End System Operation</title>
<author>
<organization>Institute of Electrical and Electronics Engineers</organization>
</author>
<date month="September" year="1990"/>
</front>

<seriesInfo name="IEEE" value="Standard 802.1Y"/>

<front>
<title>Source Routing Tutorial for End System Operation</title>
<author>
<organization>Institute of Electrical and Electronics Engineers</organization>
</author>
<date month="September" year="1990"/>
</front>
<seriesInfo name="IEEE" value="Standard 802.1Y"/>
<seriesInfo name="IEEE" value="802.1y-1990"/>
<seriesInfo name="IEEE" value="ieee-802-1y"/>
</reference></references>
</references>
<!--This document was prepared using Pandoc2rfc https://github.com/miekg/pandoc2rfc -->
Expand Down
10 changes: 5 additions & 5 deletions tests/valid/draft-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@
Insert an abstract: MANDATORY. This template is for creating an
Internet Draft.
" name="description">
<meta content="xml2rfc 3.23.1" name="generator">
<meta content="xml2rfc 3.23.2" name="generator">
<meta content="template" name="keyword">
<meta content="draft-ietf-xml2rfc-template-05" name="ietf.draft">
<!-- Generator version information:
xml2rfc 3.23.1
Python 3.12.4
xml2rfc 3.23.2
Python 3.12.7
ConfigArgParse 1.7
google-i18n-address 3.1.1
intervaltree 3.1.0
Jinja2 3.1.4
lxml 4.9.4
lxml 5.3.0
platformdirs 4.3.6
pycountry 24.6.1
pydyf 0.9.0
PyYAML 6.0.2
requests 2.32.3
setuptools 75.1.0
setuptools 75.2.0
wcwidth 0.2.13
weasyprint 61.2
-->
Expand Down
38 changes: 18 additions & 20 deletions tests/valid/draft-template.v3add-xinclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -875,16 +875,14 @@ draft-gieben-writing-rfcs-pandoc-00.txt -> draft.txt
<!-- bibxml reference -->
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4941.xml"/><!-- bibxml-misc reference -->
<reference anchor="ISO.8327.1990" xml:base="https://bib.ietf.org/public/rfc/bibxml-misc/reference.ISO.8327.1990.xml">
<front>
<title>Information processing systems - Open Systems Interconnection - Basic connection oriented session protocol specification</title>
<author>
<organization>International Organization for Standardization</organization>
</author>
<date month="April" year="1990"/>
</front>

<seriesInfo name="ISO" value="Standard 8327"/>

<front>
<title>Information processing systems - Open Systems Interconnection - Basic connection oriented session protocol specification</title>
<author>
<organization>International Organization for Standardization</organization>
</author>
<date month="April" year="1990"/>
</front>
<seriesInfo name="ISO" value="Standard 8327"/>
</reference><!-- bibxml-ids reference -->
<xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-6lo-ap-nd.xml"/><!-- bibxml-w3c reference -->
<reference anchor="W3C.CR-accelerometer-20191212" target="https://www.w3.org/TR/2019/CR-accelerometer-20191212/" xml:base="https://bib.ietf.org/public/rfc/bibxml-misc/reference.W3C.CR-accelerometer-20191212.xml">
Expand All @@ -897,16 +895,16 @@ draft-gieben-writing-rfcs-pandoc-00.txt -> draft.txt
<seriesInfo name="W3C" value="CR-accelerometer-20191212"/>
</reference><!-- bibxml-ieee reference -->
<reference anchor="IEEE.802-1Y.1990" xml:base="https://bib.ietf.org/public/rfc/bibxml-misc/reference.IEEE.802-1Y.1990.xml">
<front>
<title>Source Routing Tutorial for End System Operation</title>
<author>
<organization>Institute of Electrical and Electronics Engineers</organization>
</author>
<date month="September" year="1990"/>
</front>

<seriesInfo name="IEEE" value="Standard 802.1Y"/>

<front>
<title>Source Routing Tutorial for End System Operation</title>
<author>
<organization>Institute of Electrical and Electronics Engineers</organization>
</author>
<date month="September" year="1990"/>
</front>
<seriesInfo name="IEEE" value="Standard 802.1Y"/>
<seriesInfo name="IEEE" value="802.1y-1990"/>
<seriesInfo name="IEEE" value="ieee-802-1y"/>
</reference></references>
</references>
<!--This document was prepared using Pandoc2rfc https://github.com/miekg/pandoc2rfc -->
Expand Down
5 changes: 2 additions & 3 deletions tests/valid/elements.prepped.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" submissionType="independent" ipr="trust200902" docName="elements-00" category="info" obsoletes="1234,5678,9012,3456,7890" sortRefs="true" indexInclude="false" prepTime="2024-08-19T05:14:30" scripts="Cherokee,Common,Greek,Han,Hebrew,Latin" symRefs="true" tocDepth="3" tocInclude="true">
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" submissionType="independent" ipr="trust200902" docName="elements-00" category="info" obsoletes="1234,5678,9012,3456,7890" sortRefs="true" indexInclude="false" prepTime="2024-10-22T23:07:12" scripts="Cherokee,Common,Greek,Han,Hebrew,Latin" symRefs="true" tocDepth="3" tocInclude="true">



Expand Down Expand Up @@ -537,8 +537,7 @@ Unordered list, third bullet, fourth element:
<li pn="section-3-1.4">
<t indent="0" pn="section-3-1.4.1">Artset include with &lt;xi:include&gt;</t>
<artwork alt="IETF Logo" type="svg" align="left" pn="section-3-1.4.2">

<svg xmlns="http://www.w3.org/2000/svg" width="175" height="57" viewBox="0 0 175 57">
<svg xmlns="http://www.w3.org/2000/svg" width="175" height="57" viewBox="0 0 175 57">
<path d="M60,2l12,12l-12,12l-12-12zM88,2l12,12l-12,12l-12-12zM116,2l12,12l-12,12l-12-12zM18,16l12,12l-12,12l-12-12zM46,16l12,12l-12,12l-12-12zM74,16l12,12l-12,12l-12-12zM102,16l12,12l-12,12l-12-12zM130,16l12,12l-12,12l-12-12zM158,16l12,12l-12,12l-12-12zM60,30l12,12l-12,12l-12-12zM88,30l12,12l-12,12l-12-12zM116,30l12,12l-12,12l-12-12z" fill="black"/>
<path stroke="black" stroke-width="0.5" d="M7,27h26l13,13l14-14l14,14l28-28l14,14l14-14l15,15h26v3h-27l-14-14l-14,14l-14-14l-28,28l-14-14l-14,14l-14-14h-25z" fill="white"/>
<path d="M3,26h5v5h-5zM168,26h5v5h-5z"/>
Expand Down
16 changes: 8 additions & 8 deletions tests/valid/indexes.pages.text
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@


Network Working Group H. Person, Ed.
Internet-Draft September 26, 2024
Internet-Draft October 22, 2024
Intended status: Experimental
Expires: March 30, 2025
Expires: April 25, 2025


xml2rfc index tests
Expand All @@ -26,7 +26,7 @@ Status of This Memo
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."

This Internet-Draft will expire on March 30, 2025.
This Internet-Draft will expire on April 25, 2025.

Copyright Notice

Expand All @@ -53,9 +53,9 @@ Table of Contents



Person Expires March 30, 2025 [Page 1]
Person Expires April 25, 2025 [Page 1]

Internet-Draft xml2rfc index tests September 2024
Internet-Draft xml2rfc index tests October 2024


This is another section!
Expand Down Expand Up @@ -109,9 +109,9 @@ Index



Person Expires March 30, 2025 [Page 2]
Person Expires April 25, 2025 [Page 2]

Internet-Draft xml2rfc index tests September 2024
Internet-Draft xml2rfc index tests October 2024


E
Expand Down Expand Up @@ -165,4 +165,4 @@ Author's Address



Person Expires March 30, 2025 [Page 3]
Person Expires April 25, 2025 [Page 3]
8 changes: 4 additions & 4 deletions tests/valid/indexes.prepped.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='utf-8'?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" sortRefs="true" category="exp" submissionType="independent" ipr="trust200902" docName="indexes-00" indexInclude="true" prepTime="2024-09-26T21:56:36" scripts="Common,Latin" symRefs="true" tocDepth="3" tocInclude="true">
<!-- xml2rfc v2v3 conversion 3.23.1 -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" sortRefs="true" category="exp" submissionType="independent" ipr="trust200902" docName="indexes-00" indexInclude="true" prepTime="2024-10-22T23:07:20" scripts="Common,Latin" symRefs="true" tocDepth="3" tocInclude="true">
<!-- xml2rfc v2v3 conversion 3.23.2 -->



Expand All @@ -20,7 +20,7 @@
</postal>
</address>
</author>
<date day="26" month="09" year="2024"/>
<date day="22" month="10" year="2024"/>
<boilerplate>
<section anchor="status-of-memo" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.1">
<name slugifiedName="name-status-of-this-memo">Status of This Memo</name>
Expand All @@ -41,7 +41,7 @@
material or to cite them other than as "work in progress."
</t>
<t indent="0" pn="section-boilerplate.1-4">
This Internet-Draft will expire on 30 March 2025.
This Internet-Draft will expire on 25 April 2025.
</t>
</section>
<section anchor="copyright" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.2">
Expand Down
Loading

0 comments on commit c8f9b7f

Please sign in to comment.