'Return True iff the actual output from an example (`got`)
matches the expected output (`want`).  These strings are
always considered to match if they are identical; but
depending on what option flags the test runner is using,
several non-exact match types are also possible.  See the
documentation for `TestRunner` for more information about
option flags.'

def check_output(self, want, got, optionflags):

    got = self._toAscii(got)
    want = self._toAscii(want)
    if (got == want):
        return True
    if (not (optionflags & DONT_ACCEPT_TRUE_FOR_1)):
        if ((got, want) == ('True\n', '1\n')):
            return True
        if ((got, want) == ('False\n', '0\n')):
            return True
    if (not (optionflags & DONT_ACCEPT_BLANKLINE)):
        want = re.sub(('(?m)^%s\\s*?$' % re.escape(BLANKLINE_MARKER)), '', want)
        got = re.sub('(?m)^\\s*?$', '', got)
        if (got == want):
            return True
    if (optionflags & NORMALIZE_WHITESPACE):
        got = '    '.join(got.split())
        want = '    '.join(want.split())
        if (got == want):
            return True
    if (optionflags & ELLIPSIS):
        if _ellipsis_match(want, got):
            return True
    return False
