…
The test objects are now ready in the rough. I haven’t run them
through citeproc-js yet and I haven’t done any validity checking on
the files, but the should be close.
A minimal python file like this:On Sun, Apr 5, 2009 at 1:40 AM, Frank Bennett <@Frank_Bennett> wrote:
====
import json
import glob
import os
TESTS = glob.glob(os.path.expanduser(‘~/xbiblio/citeproc-js/branches/fbennett/std/machines/*.json’))
def run_tests():
for test_path in TESTS:
test = json.loads(open(test_path).read())
print(test)
run_tests()
… fails after the first two, with the following which probably
suggests some problems with the JSON:
Traceback (most recent call last):
File “tests/csl_test.py”, line 20, in
run_tests()
File “tests/csl_test.py”, line 13, in run_tests
test = json.loads(open(test_path).read())
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/init.py”,
line 307, in loads
return _default_decoder.decode(s)
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py”,
line 319, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py”,
line 336, in raw_decode
obj, end = self._scanner.iterscan(s, **kw).next()
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/scanner.py”,
line 55, in iterscan
rval, next_pos = action(m, context)
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py”,
line 183, in JSONObject
value, end = iterscan(s, idx=end, context=context).next()
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/scanner.py”,
line 55, in iterscan
rval, next_pos = action(m, context)
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py”,
line 217, in JSONArray
value, end = iterscan(s, idx=end, context=context).next()
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/scanner.py”,
line 55, in iterscan
rval, next_pos = action(m, context)
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py”,
line 183, in JSONObject
value, end = iterscan(s, idx=end, context=context).next()
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/scanner.py”,
line 55, in iterscan
rval, next_pos = action(m, context)
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py”,
line 219, in JSONArray
raise ValueError(errmsg(“Expecting object”, s, end))
ValueError: Expecting object: line 5 column 152 (char 823)