From f1521c9769f9b28cf658a9255dbfc16c98870da9 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Tue, 12 Jan 2016 13:14:05 +0100 Subject: Get number of passed/total tests from Prolog test functions --- monkey/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'monkey/__init__.py') diff --git a/monkey/__init__.py b/monkey/__init__.py index 83ea215..fbb4535 100644 --- a/monkey/__init__.py +++ b/monkey/__init__.py @@ -83,7 +83,8 @@ def fix(code, edits, test, timeout=30, debug=False): print('{}: {} → {}'.format(idx, stringify(a), stringify(b))) # If the code is correct, we are done. - if test(code): + n_correct, n_all = test(code) + if n_correct == n_all: return code, path, total_time, n_tested n_tested += 1 -- cgit v1.2.1