def METHOD_NAME(self, test):
    use_stdin = False
    if sys.platform == 'win32':
        test['command'] = test['command'].replace('/dev/null', 'nul')
        # There is no equivalent to /dev/stdout, /dev/stderr, /dev/stdin
        # on Windows, so skip tests that require them.
        if '/dev/std' in test['command']:
            harness.success()
            return
    if test['command'].find("-f ") != -1:
        test['command'] = '$ledger ' + test['command']
        if re.search("-f (-|/dev/stdin)(\s|$)", test['command']):
            use_stdin = True
    else:
        test['command'] = (('$ledger -f "%s" ' % 
                            os.path.realpath(self.filename)) +
                           test['command'])
    p = harness.run(test['command'],
                    columns=(not re.search('--columns', test['command'])))
    if use_stdin:
        fd = open(self.filename, encoding='utf-8')
        try:
            stdin = fd.read()
            if sys.version_info.major > 2:
                stdin = stdin.encode('utf-8')
            p.stdin.write(stdin)
        finally:
            fd.close()
    p.stdin.close()
    success = True
    printed = False
    index   = 0
    if test['output'] is not None:
        process_output = harness.readlines(p.stdout)
        expected_output = test['output']
        if sys.platform == 'win32':
            process_output = [l.replace('\r\n', '\n').replace('\\', '/')
                              for l in process_output]
            # Replace \ with / in the expected output because the line above
            # makes it impossible for the process output to have a \.
            expected_output = [l.replace('\\', '/') for l in expected_output]
        for line in unified_diff(expected_output, process_output):
            index += 1
            if index < 3:
                continue
            if not printed:
                if success: print
                self.notify_user("FAILURE in output from %s:" % self.filename, test)
                success = False
                printed = True
            if sys.version_info.major == 2 and type(line) is str:
                line = unicode(line, 'utf-8')
            print(' ', line,)
    printed = False
    index   = 0
    process_error = harness.readlines(p.stderr)
    if test['error'] is not None or process_error is not None:
        if test['error'] is None:
            test['error'] = []
        if sys.platform == 'win32':
            process_error = [l.replace('\r\n', '\n').replace('\\', '/')
                             for l in process_error]
            test['error'] = [l.replace('\\', '/') for l in test['error']]
        for line in unified_diff(test['error'], process_error):
            index += 1
            if index < 3:
                continue
            if not printed:
                if success: print
                self.notify_user("FAILURE in error output from %s:"
                                 % self.filename, test)
                success = False
                printed = True
            print(" ", line,)
    if test['exitcode'] == p.wait():
        if success:
            harness.success()
        else:
            harness.failure(os.path.basename(self.filename))
            print("STDERR:")
            print(p.stderr.read())
    else:
        if success: print
        self.notify_user("FAILURE in exit code (%d != %d) from %s:"
                         % (test['exitcode'], p.returncode, self.filename),
                         test)
        harness.failure(os.path.basename(self.filename))