From 881c9814f7fdb683d49a73be9b937c367942af0c Mon Sep 17 00:00:00 2001 From: drunkendog Date: Tue, 26 Sep 2023 18:49:55 +0100 Subject: [PATCH] Add rstrip to output --- run-tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-tests.py b/run-tests.py index 99144e8..012c4c3 100644 --- a/run-tests.py +++ b/run-tests.py @@ -30,7 +30,7 @@ for file_name in glob.glob("*.c", recursive=False): for x in to_run: x_split = x.split("\n", 1) return_data = subprocess.run(["./a.out"], input=x_split[0].rstrip().encode(), capture_output=True).stdout.decode().rstrip() - test_passed_int = int(return_data.rstrip().splitlines() == x_split[1].rstrip().splitlines()) + test_passed_int = int([z.rstrip() for z in return_data.rstrip().splitlines()] == [z.rstrip() for z in x_split[1].rstrip().splitlines()]) total_tests += 1 passed_tests += test_passed_int print(f"\u001b[{31 + test_passed_int}m({x_split[0]})\u001b[0m")