summaryrefslogtreecommitdiff
path: root/monkey/edits.py
diff options
context:
space:
mode:
Diffstat (limited to 'monkey/edits.py')
-rw-r--r--monkey/edits.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/monkey/edits.py b/monkey/edits.py
index ae44301..73f692d 100644
--- a/monkey/edits.py
+++ b/monkey/edits.py
@@ -234,13 +234,11 @@ if __name__ == '__main__':
# Check for cached results.
normal_code = stringify(rename_vars(tokenize(code)))
code_key = (normal_code, tuple(dependencies))
- if code_key in test_results[pid]:
- return test_results[pid][code_key]
-
- aux_code = '\n' + solutions_for_problems(problem.language, dependencies) + '\n' + facts
- correct, hints = problem_module.test(code, aux_code)
- test_results[pid][code_key] = correct
- return correct
+ if code_key not in test_results[pid]:
+ aux_code = '\n' + solutions_for_problems(problem.language, dependencies) + '\n' + facts
+ n_correct, n_all, _ = problem_module.test(code, aux_code)
+ test_results[pid][code_key] = (n_correct, n_all)
+ return test_results[pid][code_key]
print('Analyzing traces for {}… '.format(problem.identifier), end='', flush=True)
print('{} traces… '.format(len(solutions)), end='', flush=True)