From 60a321e51be9ad752b44b8ed16812ac8a31d7482 Mon Sep 17 00:00:00 2001 From: drunkendog Date: Tue, 12 Sep 2023 13:58:13 +0100 Subject: [PATCH] Remove locale, fix bug --- run-tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run-tests.py b/run-tests.py index c364a22..5011701 100644 --- a/run-tests.py +++ b/run-tests.py @@ -21,6 +21,6 @@ for file_name in glob.glob("*.c", recursive=False): subprocess.run(["gcc", "-std=c11", "-Wall", "-g", file_name], check=True) with open(next(x for x in file_list if file_name.rstrip(".c") in x)) as f: to_run = f.read().split("\n\n") - for x in to_run: - return_data = subprocess.run(["./a.out"], input=x[0].rstrip().encode('utf-8'), capture_output=True).stdout.decode() + for x in to_run.split(): + return_data = subprocess.run(["./a.out"], input=x[0].rstrip().encode(), capture_output=True).stdout.decode() print(f"\u001b[{31 + int(return_data.rstrip() == x[1].rstrip())}m{return_data}\u001b[0m", x[1])