

def tester(fn, wantResult):
    fn = fn.replace('\\', '\\\\')
    gotResult = eval(fn)
    if (wantResult != gotResult):
        raise TestFailed(('%s should return: %s but returned: %s' % (str(fn), str(wantResult), str(gotResult))))
    fn = fn.replace("('", "(b'")
    fn = fn.replace('("', '(b"')
    fn = wantResult.replace("['", "[b'")
    fn = fn.replace('["', '[b"')
    fn = fn.replace(", '", ", b'")
    fn = fn.replace(', "', ', b"')
    with warnings.catch_warnings():
        warnings.simplefilter('ignore', DeprecationWarning)
        gotResult = eval(fn)
    if isinstance(wantResult, str):
        wantResult = wantResult.encode('ascii')
    elif isinstance(wantResult, tuple):
        wantResult = tuple((r.encode('ascii') for r in wantResult))
    gotResult = eval(fn)
    if (wantResult != gotResult):
        raise TestFailed(('%s should return: %s but returned: %s' % (str(fn), str(wantResult), repr(gotResult))))

dataset/ETHPy150Open amrdraz/kodr/app/brython/www/src/Lib/test/test_ntpath.py tester/VarMisuse@89/123 `fn`->`wantResult`