nitunit: number docunit from 1 and correctly use it in full_name
[nit.git] / src / testing / testing_doc.nit
index a2fa067..0c6d686 100644 (file)
@@ -78,15 +78,15 @@ class NitUnitExecutor
        # All extracted docunits
        var docunits = new Array[DocUnit]
 
-       fun show_status(more_message: nullable String)
+       fun show_status
        do
-               toolcontext.show_unit_status(name, docunits, more_message)
+               toolcontext.show_unit_status(name, docunits)
        end
 
        fun mark_done(du: DocUnit)
        do
                du.is_done = true
-               show_status(du.full_name + " " + du.status_tag)
+               show_status
        end
 
        # Execute all the docunits
@@ -349,11 +349,11 @@ private class NitunitDecorator
                var mdoc = executor.mdoc
                assert mdoc != null
 
-               var next_number = 0
+               var next_number = 1
                var name = executor.xml_name
                if executor.docunits.not_empty and executor.docunits.last.mdoc == mdoc then
                        next_number = executor.docunits.last.number + 1
-                       name += "+" + next_number.to_s
+                       name += "#" + next_number.to_s
                end
 
                var res = new DocUnit(mdoc, next_number, "", executor.xml_classname, name)
@@ -379,7 +379,11 @@ class DocUnit
        redef fun full_name do
                var mentity = mdoc.original_mentity
                if mentity != null then
-                       return mentity.full_name
+                       var res = mentity.full_name
+                       if number > 1 then
+                               res += "#{number}"
+                       end
+                       return res
                else
                        return xml_classname + "." + xml_name
                end