Replace split with rsplit to enable multiline inputs

multiline-output
drunkendog 2023-09-13 15:58:46 +01:00
parent bddf5dfcfe
commit b674033e52
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,7 @@ for file_name in glob.glob("*.c", recursive=False):
to_run = f.read().split("\n\n")
total_tests, passed_tests = 0, 0
for x in to_run:
x_split = x.split("\n")
x_split = x.rsplit("\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 == x_split[1].rstrip())
total_tests += 1