From 8408e862a3d8f6d84275e519c415313449be1824 Mon Sep 17 00:00:00 2001 From: Bob Nystrom Date: Fri, 27 Feb 2015 07:22:27 -0800 Subject: [PATCH] Clean up the test script a bit. --- script/test.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/script/test.py b/script/test.py index e4acfeb6..4cbf9b19 100755 --- a/script/test.py +++ b/script/test.py @@ -141,13 +141,13 @@ def run_test(path): line_num += 1 # If any input is fed to the test in stdin, concatetate it into one string. - input_string = None - if input_lines > 0: - input_string = "".join(input_lines) + input_bytes = None + if len(input_lines) > 0: + input_bytes = "".join(input_lines).encode("utf-8") # Invoke wren and run the test. proc = Popen([WREN_APP, path], stdin=PIPE, stdout=PIPE, stderr=PIPE) - (out, err) = proc.communicate(input_string) + (out, err) = proc.communicate(input_bytes) out = out.decode("utf-8").replace('\r\n', '\n') err = err.decode("utf-8").replace('\r\n', '\n') @@ -231,10 +231,10 @@ def run_test(path): else: failed += 1 print_line(color.RED + 'FAIL' + color.DEFAULT + ': ' + path) - print('\n') + print('') for fail in fails: print(' ' + color.PINK + fail + color.DEFAULT) - print('\n') + print('') walk(TEST_DIR, run_test)