summaryrefslogtreecommitdiff
path: root/tests/scanner
diff options
context:
space:
mode:
authorJames Westman <flyingpimonster@gmail.com>2020-09-07 13:54:42 +0000
committerMathieu Duponchelle <mduponchelle1@gmail.com>2020-09-07 13:54:42 +0000
commitde6512b31b614567bf1800406303d1ccfb6d9455 (patch)
treee64f4ffd064fe31dad8d3934add58aa1a5e1b6a3 /tests/scanner
parent25dcd89afabd57f199e33cb253aa7fd7fb91ec01 (diff)
downloadgobject-introspection-de6512b31b614567bf1800406303d1ccfb6d9455.tar.gz
giscanner: Fix section matching for documentation
When writing documentation to the GIR files, GIR tries to match classes with their matching SECTION: comment in the source code. Some codebases use kebab-case or CamelCase for their section names, but GIR always expects them to be flatcase or the matching will fail. This commit converts all section names to flatcase (by removing "-" and converting to lowercase) while they are being parsed, so that they are matched properly later on. Fixes #350.
Diffstat (limited to 'tests/scanner')
-rw-r--r--tests/scanner/annotationparser/gi/identifier_section.xml34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/scanner/annotationparser/gi/identifier_section.xml b/tests/scanner/annotationparser/gi/identifier_section.xml
index fad2b2ed..380ab87b 100644
--- a/tests/scanner/annotationparser/gi/identifier_section.xml
+++ b/tests/scanner/annotationparser/gi/identifier_section.xml
@@ -329,4 +329,38 @@ returns nothing.</description>
*/</output>
</test>
+
+<test>
+ <!--
+ Section name in different case styles
+ See https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/350
+ -->
+ <input>/**
+ * SECTION:Meep-App
+ * @short_description: module for gtk-doc unit test
+ *
+ * This file contains non-sense code for the sole purpose of testing the docs.
+ */</input>
+ <parser>
+ <docblock>
+ <identifier>
+ <name>SECTION:meepapp</name>
+ </identifier>
+ <parameters>
+ <parameter>
+ <name>short_description</name>
+ <description>module for gtk-doc unit test</description>
+ </parameter>
+ </parameters>
+ <description>This file contains non-sense code for the sole purpose of testing the docs.</description>
+ </docblock>
+ </parser>
+ <output>/**
+ * SECTION:meepapp
+ * @short_description: module for gtk-doc unit test
+ *
+ * This file contains non-sense code for the sole purpose of testing the docs.
+ */</output>
+</test>
+
</tests>