10 from cppreference_parser
import _ParseSymbolPage, _ParseIndexPage
18 <a href="abs.html" title="abs"><tt>abs()</tt></a> (int) <br>
19 <a href="complex/abs.html" title="abs"><tt>abs<>()</tt></a> (std::complex) <br>
20 <a href="acos.html" title="acos"><tt>acos()</tt></a> <br>
21 <a href="acosh.html" title="acosh"><tt>acosh()</tt></a> <span class="t-mark-rev">(since C++11)</span> <br>
22 <a href="as_bytes.html" title="as bytes"><tt>as_bytes<>()</tt></a> <span class="t-mark-rev t-since-cxx20">(since C++20)</span> <br>
25 actual = _ParseIndexPage(html)
27 (
"abs",
"abs.html",
True),
28 (
"abs",
"complex/abs.html",
True),
29 (
"acos",
"acos.html",
False),
30 (
"acosh",
"acosh.html",
False),
31 (
"as_bytes",
"as_bytes.html",
False),
33 self.assertEqual(len(actual), len(expected))
34 for i
in range(0, len(actual)):
35 self.assertEqual(expected[i][0], actual[i][0])
36 self.assertTrue(actual[i][1].endswith(expected[i][1]))
37 self.assertEqual(expected[i][2], actual[i][2])
43 <table class="t-dcl-begin"><tbody>
44 <tr class="t-dsc-header">
45 <td> <div>Defined in header <code><a href="cmath.html" title="cmath"><cmath></a></code>
52 <td>this is matched</td>
56 self.assertEqual(_ParseSymbolPage(html,
'foo'), set([
'<cmath>']))
64 <table class="t-dcl-begin"><tbody>
65 <tr class="t-dsc-header">
66 <td> <div>Defined in header <code><a href="cstddef.html" title="cstddef"><cstddef></a></code>
73 <td>this mentions foo, but isn't matched</td>
75 <tr class="t-dsc-header">
76 <td> <div>Defined in header <code><a href="cstdio.html" title="cstdio"><cstdio></a></code>
81 <tr class="t-dsc-header">
82 <td> <div>Defined in header <code><a href=".cstdlib.html" title="ccstdlib"><cstdlib></a></code>
93 <td>this is matched</td>
97 self.assertEqual(_ParseSymbolPage(html,
"foo"),
98 set([
'<cstdio>',
'<cstdlib>']))
106 <table class="t-dcl-begin"><tbody>
107 <tr class="t-dsc-header">
109 Defined in header <code><a href="../header/algorithm.html" title="cpp/header/algorithm"><algorithm></a></code><br>
110 Defined in header <code><a href="../header/utility.html" title="cpp/header/utility"><utility></a></code>
120 <td>this is matched</td>
124 self.assertEqual(_ParseSymbolPage(html,
"foo"),
125 set([
'<algorithm>',
'<utility>']))
132 <table class="t-dcl-begin"><tbody>
133 <tr class="t-dsc-header">
135 Defined in header <code><a href="cstdint.html" title="cstdint"><cstdint></a></code><br>
144 <td>this is matched</td>
148 self.assertEqual(_ParseSymbolPage(html,
"int8_t"),
150 self.assertEqual(_ParseSymbolPage(html,
"int16_t"),
154 if __name__ ==
'__main__':