From eaa63906ca5a3f00132749cc927448ff13a2a80f Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 14 Feb 2025 11:35:17 -0500 Subject: [PATCH] add tests --- mrdocs.rnc | 3 +- .../golden-tests/javadoc/relates/relates.adoc | 107 ++++++++++++++++ .../golden-tests/javadoc/relates/relates.html | 121 ++++++++++++++++++ .../golden-tests/javadoc/relates/relates.xml | 33 +++++ .../symbols/concept/requires-clause.adoc | 18 +-- .../symbols/concept/requires-clause.html | 18 +-- .../symbols/concept/requires-clause.xml | 6 +- 7 files changed, 284 insertions(+), 22 deletions(-) create mode 100644 test-files/golden-tests/javadoc/relates/relates.adoc create mode 100644 test-files/golden-tests/javadoc/relates/relates.html create mode 100644 test-files/golden-tests/javadoc/relates/relates.xml diff --git a/mrdocs.rnc b/mrdocs.rnc index bf0aee028..c5f9323ab 100644 --- a/mrdocs.rnc +++ b/mrdocs.rnc @@ -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 = ( @@ -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 | diff --git a/test-files/golden-tests/javadoc/relates/relates.adoc b/test-files/golden-tests/javadoc/relates/relates.adoc new file mode 100644 index 000000000..255ba707d --- /dev/null +++ b/test-files/golden-tests/javadoc/relates/relates.adoc @@ -0,0 +1,107 @@ += Reference +:mrdocs: + +[#index] +== Global namespace + + +=== Types + +[cols=2] +|=== +| Name | Description + +| <> +| A brief for A. + +| <> +| A brief for B + +|=== +=== Functions + +[cols=2] +|=== +| Name | Description + +| <> +| A brief for f. + +|=== + +[#A] +== A + + +A brief for A. + +=== Synopsis + + +Declared in `<relates.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +struct A; +---- + + + + +=== Related functions + +[cols=2] +|=== +| Name | Description + +| <> +| A brief for f. + +|=== + +[#B] +== B + + +A brief for B + +=== Synopsis + + +Declared in `<relates.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +struct B; +---- + + + + +[#f] +== f + + +A brief for f. + +=== Synopsis + + +Declared in `<relates.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +f(); +---- + +=== Description + + + + + + + + +[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/javadoc/relates/relates.html b/test-files/golden-tests/javadoc/relates/relates.html new file mode 100644 index 000000000..ad9de8d58 --- /dev/null +++ b/test-files/golden-tests/javadoc/relates/relates.html @@ -0,0 +1,121 @@ + + +Reference + + +
+

Reference

+
+
+

Global namespace

+
+

Types

+ + + + + + + + + + + +
NameDescription
A A brief for A. + +
B A brief for B + +
+

Functions

+ + + + + + + + + + +
NameDescription
f A brief for f. + +
+
+
+
+

A

+
+A brief for A. + + +
+
+
+

Synopsis

+
+Declared in <relates.cpp>
+
+
+struct A;
+
+
+
+ + +
+
+
+

B

+
+A brief for B + + +
+
+
+

Synopsis

+
+Declared in <relates.cpp>
+
+
+struct B;
+
+
+
+ + +
+
+
+

f

+
+A brief for f. + + +
+
+
+

Synopsis

+
+Declared in <relates.cpp>
+
+
+void
+f();
+
+
+
+
+

Description

+

+ + +
+
+ +
+
+

Created with MrDocs

+
+ + \ No newline at end of file diff --git a/test-files/golden-tests/javadoc/relates/relates.xml b/test-files/golden-tests/javadoc/relates/relates.xml new file mode 100644 index 000000000..23446ff4a --- /dev/null +++ b/test-files/golden-tests/javadoc/relates/relates.xml @@ -0,0 +1,33 @@ + + + + + + + + A brief for A. + + + + + + + + A brief for B + + + + + + + + A brief for f. + + + A + + + + + diff --git a/test-files/golden-tests/symbols/concept/requires-clause.adoc b/test-files/golden-tests/symbols/concept/requires-clause.adoc index 8f400f0e1..5267c483b 100644 --- a/test-files/golden-tests/symbols/concept/requires-clause.adoc +++ b/test-files/golden-tests/symbols/concept/requires-clause.adoc @@ -99,10 +99,10 @@ Declared in `<requires‐clause.cpp>` template<typename T> requires (sizeof(T) == 2) void -<>(); +<>(); ---- -[.small]#<># +[.small]#<># @@ -111,10 +111,10 @@ void template<typename T> requires (sizeof(T) == 4) void -<>(); +<>(); ---- -[.small]#<># +[.small]#<># @@ -123,12 +123,12 @@ void template<typename U> requires (sizeof(U) == 2) void -<>(); +<>(); ---- -[.small]#<># +[.small]#<># -[#g-04] +[#g-02] == g @@ -145,7 +145,7 @@ void g(); ---- -[#g-00] +[#g-04] == g @@ -162,7 +162,7 @@ void g(); ---- -[#g-03] +[#g-0b] == g diff --git a/test-files/golden-tests/symbols/concept/requires-clause.html b/test-files/golden-tests/symbols/concept/requires-clause.html index 32c38de66..34d1697d9 100644 --- a/test-files/golden-tests/symbols/concept/requires-clause.html +++ b/test-files/golden-tests/symbols/concept/requires-clause.html @@ -109,9 +109,9 @@

Synopses

template<typename T> requires (sizeof(T) == 2) void -g(); +g(); -» more... +» more... @@ -120,9 +120,9 @@

Synopses

template<typename T> requires (sizeof(T) == 4) void -g(); +g(); -» more... +» more... @@ -131,16 +131,16 @@

Synopses

template<typename U> requires (sizeof(U) == 2) void -g(); +g(); -» more... +» more...
-

g

+

g

Synopsis

@@ -158,7 +158,7 @@

Synopsis

-

g

+

g

Synopsis

@@ -176,7 +176,7 @@

Synopsis

-

g

+

g

Synopsis

diff --git a/test-files/golden-tests/symbols/concept/requires-clause.xml b/test-files/golden-tests/symbols/concept/requires-clause.xml index 0ce46e5c7..6c43f401b 100644 --- a/test-files/golden-tests/symbols/concept/requires-clause.xml +++ b/test-files/golden-tests/symbols/concept/requires-clause.xml @@ -24,19 +24,19 @@