tags 527515 + patch thanks * Daniel Schepler <dschep...@gmail.com>, 2009-05-07, 14:39:
running build_ext error: tests/simple-2.bib: line 1: unexpected result: error: tests/simple-2.bib: line 1: obtained ('entry', ('gobry03', 'article', 0, 1, {'journal': (0, 0, 'My diary'), 'title': (2, 0, 'A simple example'), 'year': (3, 0, '2003', 2003, 0, 0), 'author': (1, 0, 'Fr\xe9d\xe9ric Gobry', [(None, 'Fr\xe9d\xe9ric', 'Gobry', None)])})) error: tests/simple-2.bib: line 1: expected ('entry', ('gobry03', 'article', 0, 1, {'journal': (0, 0, 'My diary'), 'year': (3, 0, '2003', 2003, 0, 0), 'author': (1, 0, 'Fr\xe9d\xe9ric Gobry', [(None, 'Fr\xe9d\xe9ric', 'Gobry', None)]), 'title': (2, 0, 'A simple example')})) error: tests/simple.bib: line 1: unexpected result: error: tests/simple.bib: line 1: obtained ('gobry03', 'article', 0, 1, {'journal': (0, 0, 'My diary'), 'title': (2, 0, 'A simple example'), 'year': (3, 0, '2003', 2003, 0, 0), 'author': (1, 0, 'Fr\xe9d\xe9ric Gobry', [(None, 'Fr\xe9d\xe9ric', 'Gobry', None)])}) error: tests/simple.bib: line 1: expected ('gobry03', 'article', 0, 1, {'journal': (0, 0, 'My diary'), 'year': (3, 0, '2003', 2003, 0, 0), 'author': (1, 0, 'Fr\xe9d\xe9ric Gobry', [(None, 'Fr\xe9d\xe9ric', 'Gobry', None)]), 'title': (2, 0, 'A simple example')}) testsuite: 12 checks, 3 failures error: check failed. make: *** [install] Error 1 dpkg-buildpackage: failure: fakeroot debian/rules binary gave error exit status 2
The attached patch fixes the problem. -- Jakub Wilk
diff --git a/testsuite.py b/testsuite.py --- a/testsuite.py +++ b/testsuite.py @@ -21,6 +21,14 @@ return 0 +def expected_result (obtained, valid): + if obtained == valid: + return True + try: + return eval(obtained) == eval(valid) + except SyntaxError: + return False + def check_bibtex (): @@ -65,7 +73,7 @@ valid = result.readline ().strip () - if obtained != valid: + if not expected_result(obtained, valid): sys.stderr.write ('error: %s: line %d: unexpected result:\n' % ( filename, line)) sys.stderr.write ('error: %s: line %d: obtained %s\n' % ( @@ -117,7 +125,7 @@ valid = result.readline ().strip () - if obtained != valid: + if not expected_result(obtained, valid): sys.stderr.write ('error: %s: line %d: unexpected result:\n' % ( filename, line)) sys.stderr.write ('error: %s: line %d: obtained %s\n' % (