Update run-tests.py

multiline-output
drunkendog 2023-09-12 14:04:53 +01:00
parent 33ad181a50
commit 906c9df10d
1 changed files with 2 additions and 2 deletions

View File

@ -23,5 +23,5 @@ for file_name in glob.glob("*.c", recursive=False):
to_run = f.read().split("\n\n") to_run = f.read().split("\n\n")
for x in to_run: for x in to_run:
x_split = x.split("\n") x_split = x.split("\n")
return_data = subprocess.run(["./a.out"], input=x[0].rstrip().encode(), capture_output=True).stdout.decode() return_data = subprocess.run(["./a.out"], input=x_split[0].rstrip().encode(), capture_output=True).stdout.decode().rstrip()
print(f"\u001b[{31 + int(return_data.rstrip() == x[1].rstrip())}m{return_data}\u001b[0m", x[1]) print(f"\u001b[{31 + int(return_data == x_split[1].rstrip())}m{return_data}\u001b[0m", x[1])