def TestApplyResult(fn, args, result):
    try:
        fnName = str(fn).split()[1]
    except:
        fnName = str(fn)
    progress('Testing ', fnName)
    pref = ('function ' + fnName)
    rc = fn(*args)
    if (rc != result):
        raise error(('%s failed - result not %r but %r' % (pref, result, rc)))
def TestApplyResult(fn, args, result):
    try:
        fnName = str(fn).split()[1]
    except:
        fnName = str(fn)
    progress('Testing ', fnName)
    pref = ('function ' + fnName)
    rc = fn(*args)
    if (rc != result):
        raise error(('%s failed - result not %r but %r' % (pref, result, rc)))