Skip to content

Commit 2726291

Browse files
committed
Merge branch 'waisbrot-additional-test-output'
* waisbrot-additional-test-output: additional output from the jp-compliance tool
2 parents c532a20 + f141a6d commit 2726291

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bin/jp-compliance

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,10 @@ class ComplianceTestRunner(object):
132132
process.stdin.flush()
133133
stdout, stderr = process.communicate()
134134
if 'result' in test_case:
135-
actual = json.loads(stdout)
135+
try:
136+
actual = json.loads(stdout)
137+
except:
138+
actual = stdout
136139
expected = test_case['result']
137140
if not actual == expected:
138141
self._show_failure(actual, test_case)
@@ -151,10 +154,12 @@ class ComplianceTestRunner(object):
151154
def _show_failure(self, actual, test_case):
152155
test_case['actual'] = json.dumps(actual)
153156
test_case['result'] = json.dumps(test_case['result'])
157+
test_case['given_js'] = json.dumps(test_case['given'])
154158
failure_message = (
155159
"\nFAIL {category},{group_number},{test_number}\n"
156160
"The expression: {expression}\n"
157161
"was suppose to give: {result}\n"
162+
"for the JSON: {given_js}\n"
158163
"but instead gave: {actual}\n"
159164
).format(**test_case)
160165
sys.stdout.write(failure_message)

0 commit comments

Comments
 (0)