Did I find the right examples for you? yes no

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)

        def _compare_text(s1, s2):
    if s1 == s2:
        return []
    i = 0
    for i in range(min(len(s1), len(s2))):
        if s1[i] != s2[i]:
            prefix = s1[:i]
            break
    else:
        prefix = s1
        i += 1
    lineno = prefix.count("\n")+1
    line_start = prefix.rfind("\n")+1
    s1_rest = s1[i:i+20]
    s2_rest = s2[i:i+20]
    return ["Difference at line %d col %d" % (lineno, i-line_start+1),
            "prefix: %r" % (s1[line_start:i],),
            "s1 continues: %r" % (s1_rest,),
            "s2 continues: %r" % (s2_rest,),]
        


src/a/m/Amara-2.0.0/test/xslt/test_message.py   Amara(Download)
import os
 
from xslt_support import _run_xml, _run_html, _compare_text
 
module_name = os.path.dirname(__file__)
        expected = expected)
    messages = message_stream.getvalue()
    diff = _compare_text(messages, expected_messages)
 
    if diff: