Ejemplo n.º 1
0
def context(expected, actual):
    """Context diff format: http://en.wikipedia.org/wiki/Diff#Context_format
    This seems to be more useful for compiler output.
    """
    return ''.join(
        difflib.ndiff(
            posix_newlines(expected).splitlines(True),
            posix_newlines(actual).splitlines(True)
        )
    )
Ejemplo n.º 2
0
def unified(expected, actual):
    """Unified diff format: http://en.wikipedia.org/wiki/Diff#Unified_format
    """
    return ''.join(
        difflib.unified_diff(
            posix_newlines(expected).splitlines(True),
            posix_newlines(actual).splitlines(True),
            fromfile='expected',
            tofile='actual'
        )
    )
Ejemplo n.º 3
0
    def test_passed(self, test, output):
        output = util.posix_newlines(output)

        print self._result_message.format(
            test_path=test.source.path_to,
            test_name=test.source.filename,
            output=output
        )
        self._certify(test, output)

        print "\n\n" + ("=" * 80) + "\n\n"