Skip to content

Commit 6892049

Browse files
committed
Preprocess: add test for remove_fileinfo
This adds a test for the `remove_fileinfo` function, and also changes the test input file to include the modifications made by lxml during serialization (e.g. removing the slash in empty tags).
1 parent 614a7d9 commit 6892049

7 files changed

Lines changed: 773 additions & 46 deletions

File tree

tests/preprocess_data/fabs.html

Lines changed: 53 additions & 46 deletions
Large diffs are not rendered by default.

tests/preprocess_data/fabs_ads.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,13 @@ <h3><span class="editsection">[<a href="https://en.cppreference.com/mwiki/index.
462462
<h3><span class="editsection">[<a href="https://en.cppreference.com/mwiki/index.php?title=cpp/numeric/math/fabs&amp;action=edit&amp;section=2" title="Edit section: Return value">edit</a>]</span> <span class="mw-headline" id="Return_value">Return value</span></h3>
463463
<p>If successful, returns the absolute value of <code>arg</code> (<code>|arg|</code>). The value returned is exact and does not depend on any rounding modes.
464464
</p>
465+
<div class="t-inheritance-diagram">
466+
<div class="center"><div class="noresize" style="height: 377px; width: 549px; "><map name="ImageMap_1_1158767600"><area href="io/ios_base.html" shape="rect" coords="225,4,328,36" alt="cpp/io/ios base" title="cpp/io/ios base"><area href="io/basic_ios.html" shape="rect" coords="218,62,335,100" alt="cpp/io/basic ios" title="cpp/io/basic ios"><area href="io/basic_istream.html" shape="rect" coords="305,126,422,164" alt="cpp/io/basic istream" title="cpp/io/basic istream"><area href="io/basic_ifstream.html" shape="rect" coords="419,319,536,357" alt="cpp/io/basic ifstream" title="cpp/io/basic ifstream"><area href="io/basic_istringstream.html" shape="rect" coords="410,255,545,292" alt="cpp/io/basic istringstream" title="cpp/io/basic istringstream"><area href="io/basic_ostream.html" shape="rect" coords="130,126,247,164" alt="cpp/io/basic ostream" title="cpp/io/basic ostream"><area href="io/basic_ofstream.html" shape="rect" coords="14,319,132,357" alt="cpp/io/basic ofstream" title="cpp/io/basic ofstream"><area href="io/basic_ostringstream.html" shape="rect" coords="4,255,143,292" alt="cpp/io/basic ostringstream" title="cpp/io/basic ostringstream"><area href="io/basic_fstream.html" shape="rect" coords="200,319,318,357" alt="cpp/io/basic fstream" title="cpp/io/basic fstream"><area href="io/basic_stringstream.html" shape="rect" coords="193,255,325,292" alt="cpp/io/basic stringstream" title="cpp/io/basic stringstream"><area href="io/basic_iostream.html" shape="rect" coords="221,190,339,228" alt="cpp/io/basic iostream" title="cpp/io/basic iostream"></map><img alt="std-io-complete-inheritance.svg" src="../../../upload.cppreference.com/mwiki/images/0/06/std-io-complete-inheritance.svg" width="549" height="377" usemap="#ImageMap_1_1158767600"><div style="margin-left: 529px; margin-top: -20px; text-align: left;"><a href="https://en.cppreference.com/w/File:std-io-complete-inheritance.svg" title="About this image"><img alt="About this image" src="../../mwiki/extensions/ImageMap/desc-20.png" style="border: none;"></a></div></div></div>
467+
<div style="text-align:center;">
468+
<p><span style="font-size:0.7em; line-height:130%">Inheritance diagram</span>
469+
</p>
470+
</div>
471+
</div>
465472
<h3><span class="editsection">[<a href="https://en.cppreference.com/mwiki/index.php?title=cpp/numeric/math/fabs&amp;action=edit&amp;section=3" title="Edit section: Error handling">edit</a>]</span> <span class="mw-headline" id="Error_handling">Error handling</span></h3>
466473
<p>This function is not subject to any of the error conditions specified in <a href="math_errhandling.html" title="cpp/numeric/math/math errhandling">math_errhandling</a>
467474
</p><p>If the implementation supports IEEE floating-point arithmetic (IEC 60559),

tests/preprocess_data/fabs_fileinfo.html

Lines changed: 688 additions & 0 deletions
Large diffs are not rendered by default.

tests/preprocess_data/fabs_ga.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,13 @@ <h3><span class="editsection">[<a href="https://en.cppreference.com/mwiki/index.
526526
<h3><span class="editsection">[<a href="https://en.cppreference.com/mwiki/index.php?title=cpp/numeric/math/fabs&amp;action=edit&amp;section=2" title="Edit section: Return value">edit</a>]</span> <span class="mw-headline" id="Return_value">Return value</span></h3>
527527
<p>If successful, returns the absolute value of <code>arg</code> (<code>|arg|</code>). The value returned is exact and does not depend on any rounding modes.
528528
</p>
529+
<div class="t-inheritance-diagram">
530+
<div class="center"><div class="noresize" style="height: 377px; width: 549px; "><map name="ImageMap_1_1158767600"><area href="io/ios_base.html" shape="rect" coords="225,4,328,36" alt="cpp/io/ios base" title="cpp/io/ios base"><area href="io/basic_ios.html" shape="rect" coords="218,62,335,100" alt="cpp/io/basic ios" title="cpp/io/basic ios"><area href="io/basic_istream.html" shape="rect" coords="305,126,422,164" alt="cpp/io/basic istream" title="cpp/io/basic istream"><area href="io/basic_ifstream.html" shape="rect" coords="419,319,536,357" alt="cpp/io/basic ifstream" title="cpp/io/basic ifstream"><area href="io/basic_istringstream.html" shape="rect" coords="410,255,545,292" alt="cpp/io/basic istringstream" title="cpp/io/basic istringstream"><area href="io/basic_ostream.html" shape="rect" coords="130,126,247,164" alt="cpp/io/basic ostream" title="cpp/io/basic ostream"><area href="io/basic_ofstream.html" shape="rect" coords="14,319,132,357" alt="cpp/io/basic ofstream" title="cpp/io/basic ofstream"><area href="io/basic_ostringstream.html" shape="rect" coords="4,255,143,292" alt="cpp/io/basic ostringstream" title="cpp/io/basic ostringstream"><area href="io/basic_fstream.html" shape="rect" coords="200,319,318,357" alt="cpp/io/basic fstream" title="cpp/io/basic fstream"><area href="io/basic_stringstream.html" shape="rect" coords="193,255,325,292" alt="cpp/io/basic stringstream" title="cpp/io/basic stringstream"><area href="io/basic_iostream.html" shape="rect" coords="221,190,339,228" alt="cpp/io/basic iostream" title="cpp/io/basic iostream"></map><img alt="std-io-complete-inheritance.svg" src="../../../upload.cppreference.com/mwiki/images/0/06/std-io-complete-inheritance.svg" width="549" height="377" usemap="#ImageMap_1_1158767600"><div style="margin-left: 529px; margin-top: -20px; text-align: left;"><a href="https://en.cppreference.com/w/File:std-io-complete-inheritance.svg" title="About this image"><img alt="About this image" src="../../mwiki/extensions/ImageMap/desc-20.png" style="border: none;"></a></div></div></div>
531+
<div style="text-align:center;">
532+
<p><span style="font-size:0.7em; line-height:130%">Inheritance diagram</span>
533+
</p>
534+
</div>
535+
</div>
529536
<h3><span class="editsection">[<a href="https://en.cppreference.com/mwiki/index.php?title=cpp/numeric/math/fabs&amp;action=edit&amp;section=3" title="Edit section: Error handling">edit</a>]</span> <span class="mw-headline" id="Error_handling">Error handling</span></h3>
530537
<p>This function is not subject to any of the error conditions specified in <a href="math_errhandling.html" title="cpp/numeric/math/math errhandling">math_errhandling</a>
531538
</p><p>If the implementation supports IEEE floating-point arithmetic (IEC 60559),

tests/preprocess_data/fabs_noprint.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,13 @@ <h3><span class="mw-headline" id="Parameters">Parameters</span></h3>
428428
<h3><span class="mw-headline" id="Return_value">Return value</span></h3>
429429
<p>If successful, returns the absolute value of <code>arg</code> (<code>|arg|</code>). The value returned is exact and does not depend on any rounding modes.
430430
</p>
431+
<div class="t-inheritance-diagram">
432+
<div class="center"><div class="noresize" style="height: 377px; width: 549px; "><map name="ImageMap_1_1158767600"><area href="io/ios_base.html" shape="rect" coords="225,4,328,36" alt="cpp/io/ios base" title="cpp/io/ios base"><area href="io/basic_ios.html" shape="rect" coords="218,62,335,100" alt="cpp/io/basic ios" title="cpp/io/basic ios"><area href="io/basic_istream.html" shape="rect" coords="305,126,422,164" alt="cpp/io/basic istream" title="cpp/io/basic istream"><area href="io/basic_ifstream.html" shape="rect" coords="419,319,536,357" alt="cpp/io/basic ifstream" title="cpp/io/basic ifstream"><area href="io/basic_istringstream.html" shape="rect" coords="410,255,545,292" alt="cpp/io/basic istringstream" title="cpp/io/basic istringstream"><area href="io/basic_ostream.html" shape="rect" coords="130,126,247,164" alt="cpp/io/basic ostream" title="cpp/io/basic ostream"><area href="io/basic_ofstream.html" shape="rect" coords="14,319,132,357" alt="cpp/io/basic ofstream" title="cpp/io/basic ofstream"><area href="io/basic_ostringstream.html" shape="rect" coords="4,255,143,292" alt="cpp/io/basic ostringstream" title="cpp/io/basic ostringstream"><area href="io/basic_fstream.html" shape="rect" coords="200,319,318,357" alt="cpp/io/basic fstream" title="cpp/io/basic fstream"><area href="io/basic_stringstream.html" shape="rect" coords="193,255,325,292" alt="cpp/io/basic stringstream" title="cpp/io/basic stringstream"><area href="io/basic_iostream.html" shape="rect" coords="221,190,339,228" alt="cpp/io/basic iostream" title="cpp/io/basic iostream"></map><img alt="std-io-complete-inheritance.svg" src="../../../upload.cppreference.com/mwiki/images/0/06/std-io-complete-inheritance.svg" width="549" height="377" usemap="#ImageMap_1_1158767600"><div style="margin-left: 529px; margin-top: -20px; text-align: left;"><a href="https://en.cppreference.com/w/File:std-io-complete-inheritance.svg" title="About this image"><img alt="About this image" src="../../mwiki/extensions/ImageMap/desc-20.png" style="border: none;"></a></div></div></div>
433+
<div style="text-align:center;">
434+
<p><span style="font-size:0.7em; line-height:130%">Inheritance diagram</span>
435+
</p>
436+
</div>
437+
</div>
431438
<h3><span class="mw-headline" id="Error_handling">Error handling</span></h3>
432439
<p>This function is not subject to any of the error conditions specified in <a href="math_errhandling.html" title="cpp/numeric/math/math errhandling">math_errhandling</a>
433440
</p><p>If the implementation supports IEEE floating-point arithmetic (IEC 60559),

tests/preprocess_data/fabs_seealso.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,13 @@ <h3><span class="editsection">[<a href="https://en.cppreference.com/mwiki/index.
526526
<h3><span class="editsection">[<a href="https://en.cppreference.com/mwiki/index.php?title=cpp/numeric/math/fabs&amp;action=edit&amp;section=2" title="Edit section: Return value">edit</a>]</span> <span class="mw-headline" id="Return_value">Return value</span></h3>
527527
<p>If successful, returns the absolute value of <code>arg</code> (<code>|arg|</code>). The value returned is exact and does not depend on any rounding modes.
528528
</p>
529+
<div class="t-inheritance-diagram">
530+
<div class="center"><div class="noresize" style="height: 377px; width: 549px; "><map name="ImageMap_1_1158767600"><area href="io/ios_base.html" shape="rect" coords="225,4,328,36" alt="cpp/io/ios base" title="cpp/io/ios base"><area href="io/basic_ios.html" shape="rect" coords="218,62,335,100" alt="cpp/io/basic ios" title="cpp/io/basic ios"><area href="io/basic_istream.html" shape="rect" coords="305,126,422,164" alt="cpp/io/basic istream" title="cpp/io/basic istream"><area href="io/basic_ifstream.html" shape="rect" coords="419,319,536,357" alt="cpp/io/basic ifstream" title="cpp/io/basic ifstream"><area href="io/basic_istringstream.html" shape="rect" coords="410,255,545,292" alt="cpp/io/basic istringstream" title="cpp/io/basic istringstream"><area href="io/basic_ostream.html" shape="rect" coords="130,126,247,164" alt="cpp/io/basic ostream" title="cpp/io/basic ostream"><area href="io/basic_ofstream.html" shape="rect" coords="14,319,132,357" alt="cpp/io/basic ofstream" title="cpp/io/basic ofstream"><area href="io/basic_ostringstream.html" shape="rect" coords="4,255,143,292" alt="cpp/io/basic ostringstream" title="cpp/io/basic ostringstream"><area href="io/basic_fstream.html" shape="rect" coords="200,319,318,357" alt="cpp/io/basic fstream" title="cpp/io/basic fstream"><area href="io/basic_stringstream.html" shape="rect" coords="193,255,325,292" alt="cpp/io/basic stringstream" title="cpp/io/basic stringstream"><area href="io/basic_iostream.html" shape="rect" coords="221,190,339,228" alt="cpp/io/basic iostream" title="cpp/io/basic iostream"></map><img alt="std-io-complete-inheritance.svg" src="../../../upload.cppreference.com/mwiki/images/0/06/std-io-complete-inheritance.svg" width="549" height="377" usemap="#ImageMap_1_1158767600"><div style="margin-left: 529px; margin-top: -20px; text-align: left;"><a href="https://en.cppreference.com/w/File:std-io-complete-inheritance.svg" title="About this image"><img alt="About this image" src="../../mwiki/extensions/ImageMap/desc-20.png" style="border: none;"></a></div></div></div>
531+
<div style="text-align:center;">
532+
<p><span style="font-size:0.7em; line-height:130%">Inheritance diagram</span>
533+
</p>
534+
</div>
535+
</div>
529536
<h3><span class="editsection">[<a href="https://en.cppreference.com/mwiki/index.php?title=cpp/numeric/math/fabs&amp;action=edit&amp;section=3" title="Edit section: Error handling">edit</a>]</span> <span class="mw-headline" id="Error_handling">Error handling</span></h3>
530537
<p>This function is not subject to any of the error conditions specified in <a href="math_errhandling.html" title="cpp/numeric/math/math errhandling">math_errhandling</a>
531538
</p><p>If the implementation supports IEEE floating-point arithmetic (IEC 60559),

tests/test_preprocess.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@ def test_remove_ads(self):
226226
remove_ads(self.html)
227227
self.check_output("fabs_ads.html")
228228

229+
def test_remove_fileinfo(self):
230+
remove_fileinfo(self.html)
231+
self.check_output("fabs_fileinfo.html")
232+
229233
def remove_unused_external(self):
230234
# TODO split out and test
231235
pass

0 commit comments

Comments
 (0)