This file is indexed.

/usr/lib/python2.7/dist-packages/cvs2svn_rcsparse/run-tests.py is in cvs2svn 2.4.0-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#! /usr/bin/python

# (Be in -*- python -*- mode.)
#
# ====================================================================
# Copyright (c) 2007 CollabNet.  All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.  The terms
# are also available at http://subversion.tigris.org/license-1.html.
# If newer versions of this license are posted there, you may use a
# newer version instead, at your option.
#
# This software consists of voluntary contributions made by many
# individuals.  For exact contribution history, see the revision
# history and logs, available at http://viewvc.tigris.org/.
# ====================================================================

"""Run tests of rcsparse code."""

import sys
import os
import glob
from cStringIO import StringIO
from difflib import Differ

# Since there is nontrivial logic in __init__.py, we have to import
# parse() via that file.  First make sure that the directory
# containing this script is in the path:
script_dir = os.path.dirname(sys.argv[0])
sys.path.insert(0, script_dir)

from __init__ import parse
from parse_rcs_file import LoggingSink


test_dir = os.path.join(script_dir, 'test-data')

filelist = glob.glob(os.path.join(test_dir, '*,v'))
filelist.sort()

all_tests_ok = 1

for filename in filelist:
    sys.stderr.write('%s: ' % (filename,))
    f = StringIO()
    try:
        parse(open(filename, 'rb'), LoggingSink(f))
    except Exception, e:
        sys.stderr.write('Error parsing file: %s!\n' % (e,))
        all_tests_ok = 0
    else:
        output = f.getvalue()

        expected_output_filename = filename[:-2] + '.out'
        expected_output = open(expected_output_filename, 'rb').read()

        if output == expected_output:
            sys.stderr.write('OK\n')
        else:
            sys.stderr.write('Output does not match expected output!\n')
            differ = Differ()
            for diffline in differ.compare(
                expected_output.splitlines(1), output.splitlines(1)
                ):
                sys.stderr.write(diffline)
            all_tests_ok = 0

if all_tests_ok:
    sys.exit(0)
else:
    sys.exit(1)