- added Features class that describes allowed extension for Reader, to allow for strict configuration
- added tests from json.org jsonchecker and modified jsontestrunner to use strict parsing mode when executing them
diff --git a/test/runjsontests.py b/test/runjsontests.py
index 2cf37e2..fa85972 100644
--- a/test/runjsontests.py
+++ b/test/runjsontests.py
@@ -3,6 +3,7 @@
import os.path
from glob import glob
+RUN_JSONCHECKER = True
def compareOutputs( expected, actual, message ):
expected = expected.strip().replace('\r','').split('\n')
@@ -39,7 +40,10 @@
if not input_dir:
input_dir = os.getcwd()
tests = glob( os.path.join( input_dir, '*.json' ) )
- test_jsonchecker = glob( os.path.join( input_dir, 'jsonchecker', '*.json' ) )
+ if RUN_JSONCHECKER:
+ test_jsonchecker = glob( os.path.join( input_dir, 'jsonchecker', '*.json' ) )
+ else:
+ test_jsonchecker = []
failed_tests = []
for input_path in tests + test_jsonchecker:
is_json_checker_test = input_path in test_jsonchecker
@@ -54,7 +58,8 @@
if expect_failure:
if status is None:
print 'FAILED'
- failed_tests.append( (input_path, 'Parsing should have failed') )
+ failed_tests.append( (input_path, 'Parsing should have failed:\n%s' %
+ safeReadFile(input_path)) )
else:
print 'OK'
else: