[gtk-doc] scan: start a unit test suite for the scanner.



commit e29cd7f452b449328746af7528339e6983b0ba21
Author: Stefan Sauer <ensonic users sf net>
Date:   Mon Nov 19 07:52:52 2018 +0100

    scan: start a unit test suite for the scanner.
    
    Based on the last refactoring we can move the tests from the 'bugs' suite
    here. Add 3 very basic tests for a start.

 gtkdoc/scan.py    | 5 +++--
 tests/Makefile.am | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gtkdoc/scan.py b/gtkdoc/scan.py
index 0d99558..2a2b4ba 100644
--- a/gtkdoc/scan.py
+++ b/gtkdoc/scan.py
@@ -279,7 +279,7 @@ def ScanHeaderContent(input_lines, decl_list, get_types, options):
     # Holds the resulting list of declarations.
     slist = []
     # Holds the title of the section
-    title = ''
+    title = None
     # True if we are in a comment.
     in_comment = 0
     # The type of declaration we are in, e.g. 'function' or 'macro'.
@@ -878,7 +878,8 @@ def ScanHeaderContent(input_lines, decl_list, get_types, options):
             decl_list.append(forward_decls[symbol])
 
     # add title
-    slist = [title] + slist
+    if title:
+        slist = [title] + slist
     return slist, doc_comments
 
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index cbd7402..991798e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -7,7 +7,7 @@ SUBDIRS = annotations bugs empty fail gobject program repro .
 if BUILD_TESTS
 
 TESTS = \
-  check.py common.py mk_to_db.py mkhtml2.py \
+  check.py common.py mk_to_db.py mkhtml2.py scan.py \
   tools.sh \
   annotations.sh bugs.sh empty.sh fail.sh gobject.sh program.sh
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]