code: def checkdiff(a,b,sp=True):
    'take diff of a to b, apply to a, return the applied diff so external code can check it against b'
    if sp: a=splitpreserve(a); b=splitpreserve(b)
    res=applydiff(a,rediff(a,b))
    if sp: res=''.join(res)
    return ref checkdiff(a,b,sp=True):
    'take diff of a to b, apply to a, return the applied diff so external code can check it against b'
    if sp: a=splitpreserve(a); b=splitpreserve(b)
    res=applydiff(a,rediff(a,b))
    if sp: res=''.join(res)
    return res
docs: take diff of a to b, apply to a, return the applied diff so external code can check it against b