Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sdkrystian committed Feb 14, 2025
1 parent fcb6ce3 commit eaa6390
Show file tree
Hide file tree
Showing 7 changed files with 284 additions and 22 deletions.
3 changes: 2 additions & 1 deletion mrdocs.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ grammar
Postcondition = element post { TextNode * }
Details = element details { TextNode * }

TextNode = ( Link | Styled | Text | Reference | Copied )
TextNode = ( Link | Styled | Text | Reference | Related | Copied )

Link = element link { attribute href { text }, text }
Styled = (
Expand All @@ -426,6 +426,7 @@ grammar
element italic { text } )
Text = element text { text }
Reference = element reference { ID ?, text }
Related = element relates { ID ?, text }
Copied =
element (
copydoc |
Expand Down
107 changes: 107 additions & 0 deletions test-files/golden-tests/javadoc/relates/relates.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
= Reference
:mrdocs:

[#index]
== Global namespace


=== Types

[cols=2]
|===
| Name | Description

| <<A,`A`>>
| A brief for A&period;

| <<B,`B`>>
| A brief for B

|===
=== Functions

[cols=2]
|===
| Name | Description

| <<f,`f`>>
| A brief for f&period;

|===

[#A]
== A


A brief for A&period;

=== Synopsis


Declared in `&lt;relates&period;cpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct A;
----




=== Related functions

[cols=2]
|===
| Name | Description

| <<f,`f`>>
| A brief for f&period;

|===

[#B]
== B


A brief for B

=== Synopsis


Declared in `&lt;relates&period;cpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct B;
----




[#f]
== f


A brief for f&period;

=== Synopsis


Declared in `&lt;relates&period;cpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
f();
----

=== Description








[.small]#Created with https://www.mrdocs.com[MrDocs]#
121 changes: 121 additions & 0 deletions test-files/golden-tests/javadoc/relates/relates.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<html lang="en">
<head>
<title>Reference</title>
</head>
<body>
<div>
<h1>Reference</h1>
<div>
<div>
<h2 id="index">Global namespace</h2>
</div>
<h2>Types</h2>
<table style="table-layout: fixed; width: 100%;">
<thead>
<tr>
<th>Name</th><th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#A"><code>A</code></a> </td><td><span><span>A brief for A.</span></span>

</td></tr><tr>
<td><a href="#B"><code>B</code></a> </td><td><span><span>A brief for B</span></span>

</td></tr>
</tbody>
</table>
<h2>Functions</h2>
<table style="table-layout: fixed; width: 100%;">
<thead>
<tr>
<th>Name</th><th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#f"><code>f</code></a> </td><td><span><span>A brief for f.</span></span>

</td></tr>
</tbody>
</table>
</div>
<div>
<div>
<h2 id="A">A</h2>
<div>
<span><span>A brief for A.</span></span>


</div>
</div>
<div>
<h3>Synopsis</h3>
<div>
Declared in <code>&lt;relates.cpp&gt;</code></div>
<pre>
<code class="source-code cpp">
struct A;
</code>
</pre>
</div>


</div>
<div>
<div>
<h2 id="B">B</h2>
<div>
<span><span>A brief for B</span></span>


</div>
</div>
<div>
<h3>Synopsis</h3>
<div>
Declared in <code>&lt;relates.cpp&gt;</code></div>
<pre>
<code class="source-code cpp">
struct B;
</code>
</pre>
</div>


</div>
<div>
<div>
<h2 id="f">f</h2>
<div>
<span><span>A brief for f.</span></span>


</div>
</div>
<div>
<h3>Synopsis</h3>
<div>
Declared in <code>&lt;relates.cpp&gt;</code></div>
<pre>
<code class="source-code cpp">
void
f();
</code>
</pre>
</div>
<div>
<h3>Description</h3>
<p></p>


</div>
</div>

</div>
<div>
<h4>Created with <a href="https://www.mrdocs.com">MrDocs</a></h4>
</div>
</body>
</html>
33 changes: 33 additions & 0 deletions test-files/golden-tests/javadoc/relates/relates.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<mrdocs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://github.com/cppalliance/mrdocs/raw/develop/mrdocs.rnc">
<namespace id="//////////////////////////8=">
<struct name="A" id="YrPSaKAbmXgzCAX5WByx4eVoqBM=">
<file short-path="relates.cpp" source-path="relates.cpp" line="3" class="def"/>
<doc>
<brief>
<text>A brief for A.</text>
</brief>
</doc>
</struct>
<struct name="B" id="3JsK1DO0O+wZhv+0meptQrbs3fY=">
<file short-path="relates.cpp" source-path="relates.cpp" line="7" class="def"/>
<doc>
<brief>
<text>A brief for B</text>
</brief>
</doc>
</struct>
<function name="f" id="s6nsa+zVhpzzrN+yUVPP5rvdXqs=">
<file short-path="relates.cpp" source-path="relates.cpp" line="13"/>
<doc>
<brief>
<text>A brief for f.</text>
</brief>
<para>
<relates id="YrPSaKAbmXgzCAX5WByx4eVoqBM=">A</relates>
</para>
</doc>
</function>
</namespace>
</mrdocs>
18 changes: 9 additions & 9 deletions test-files/golden-tests/symbols/concept/requires-clause.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ Declared in `&lt;requires&hyphen;clause&period;cpp&gt;`
template&lt;typename T&gt;
requires (sizeof(T) &equals;&equals; 2)
void
<<g-04,g>>();
<<g-02,g>>();
----

[.small]#<<g-04,_» more&period;&period;&period;_>>#
[.small]#<<g-02,_» more&period;&period;&period;_>>#



Expand All @@ -111,10 +111,10 @@ void
template&lt;typename T&gt;
requires (sizeof(T) &equals;&equals; 4)
void
<<g-00,g>>();
<<g-04,g>>();
----

[.small]#<<g-00,_» more&period;&period;&period;_>>#
[.small]#<<g-04,_» more&period;&period;&period;_>>#



Expand All @@ -123,12 +123,12 @@ void
template&lt;typename U&gt;
requires (sizeof(U) &equals;&equals; 2)
void
<<g-03,g>>();
<<g-0b,g>>();
----

[.small]#<<g-03,_» more&period;&period;&period;_>>#
[.small]#<<g-0b,_» more&period;&period;&period;_>>#

[#g-04]
[#g-02]
== g


Expand All @@ -145,7 +145,7 @@ void
g();
----

[#g-00]
[#g-04]
== g


Expand All @@ -162,7 +162,7 @@ void
g();
----

[#g-03]
[#g-0b]
== g


Expand Down
Loading

0 comments on commit eaa6390

Please sign in to comment.