Add splitlines to prevent newlines from messing up multiline output
Tests / Run-Tests (push) Successful in 7s Details
Benchmarks / Run-Benchmarks (push) Successful in 22s Details

main
drunkendog 2023-09-26 17:48:45 +01:00
parent 1941de0ded
commit e4928c4401
1 changed files with 1 additions and 1 deletions

View File

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