summaryrefslogtreecommitdiff
path: root/monkey/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'monkey/test.py')
-rwxr-xr-xmonkey/test.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/monkey/test.py b/monkey/test.py
index 83aa0c2..17c27fe 100755
--- a/monkey/test.py
+++ b/monkey/test.py
@@ -11,7 +11,7 @@ from .edits import classify_edits, trace_graph
from .graph import graphviz
from .monkey import fix
from prolog.engine import test
-from prolog.util import compose, decompose, stringify
+from prolog.util import annotate, compose, stringify
from .util import indent
# Load django models.
@@ -57,10 +57,10 @@ def print_hint(solution, steps, fix_time, n_tested):
if solution:
print(colored('Hint found! Tested {} programs in {:.1f} s.'.format(n_tested, fix_time), 'green'))
print(colored(' Edits', 'blue'))
- for step_type, line, (before, after) in steps:
- print(' {}: {} {} → {}'.format(line, step_type, stringify(before), stringify(after)))
+ for step_type, pos, a, b in steps:
+ print(' {}: {} {} → {}'.format(pos, step_type, stringify(a), stringify(b)))
print(colored(' Final version', 'blue'))
- print(indent(compose(*decompose(solution)), 2))
+ print(indent(compose(annotate(solution)), 2))
else:
print(colored('Hint not found! Tested {} programs in {:.1f} s.'.format(n_tested, fix_time), 'red'))
@@ -75,7 +75,7 @@ if len(sys.argv) >= 3 and sys.argv[2] == 'test':
if program in done:
continue
print(colored('Analyzing program {0}/{1}…'.format(i+1, len(incorrect)), 'yellow'))
- print(indent(compose(*decompose(program)), 2))
+ print(indent(compose(annotate(program)), 2))
solution, steps, fix_time, n_tested = fix(problem.name, program, edits, aux_code=aux_code, timeout=timeout)
if solution:
@@ -119,7 +119,7 @@ elif len(sys.argv) >= 3 and sys.argv[2] == 'info':
for p in sorted(incorrect):
if p in done:
continue
- print(indent(compose(*decompose(p)), 2))
+ print(indent(compose(annotate(p)), 2))
print()
# Print all student queries and their counts.
elif sys.argv[3] == 'queries':