From ece9ae17bf70552e340c3d2bccba696cac9d8c19 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Thu, 2 Jun 2016 17:32:22 -0400 Subject: [PATCH] nitunit: number docunit from 1 and correctly use it in full_name Signed-off-by: Jean Privat --- src/testing/testing_doc.nit | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/testing/testing_doc.nit b/src/testing/testing_doc.nit index 1ca4deb..0c6d686 100644 --- a/src/testing/testing_doc.nit +++ b/src/testing/testing_doc.nit @@ -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 -- 1.7.9.5