The LineSorter QMTest preprocessor is broken
LineSorter is currently stripping the line contents instead of sorting. In particular, it strips the trailing \n
and because it comes after normalizeEOL
in the normalizeExamples
preprocessor, there are lines without a trailing '\n'. This in turn is a problem for the ReferenceFileValidator
where difflib.ndiff
does not ignore \n
.
The fix is simple:
diff --git GaudiPolicy/python/GaudiTesting/BaseTest.py GaudiPolicy/python/GaudiTesting/BaseTest.py
index 272f9ed79..0ecdab63f 100644
--- GaudiPolicy/python/GaudiTesting/BaseTest.py
+++ GaudiPolicy/python/GaudiTesting/BaseTest.py
@@ -903,10 +903,9 @@ class LineSorter(FilePreprocessor):
def __processLine__(self, line):
pos = line.find(self.signature)
if pos >= 0:
- line = line[:(pos + self.siglen)]
lst = line[(pos + self.siglen):].split()
lst.sort()
- line += " ".join(lst)
+ line = line[:(pos + self.siglen)] + " ".join(lst)
return line