mirror of
https://gitlab.com/arnekeller/kit-programmieren-ws1920-final2.git
synced 2024-11-23 17:04:59 +00:00
Add script to generate codetester tests
This commit is contained in:
parent
48d014e4de
commit
b42d783127
25
check_from_input_output.py
Normal file
25
check_from_input_output.py
Normal file
@ -0,0 +1,25 @@
|
||||
import sys
|
||||
|
||||
fuzz = sys.argv[1]
|
||||
|
||||
input = open(fuzz + "_input.txt", "r")
|
||||
output = open(fuzz + "_output.txt", "r")
|
||||
|
||||
in_lines = input.readlines()
|
||||
out_lines = output.readlines()
|
||||
for i in range(0, len(in_lines)):
|
||||
if not in_lines[i].startswith("#"):
|
||||
print(">", in_lines[i], end="")
|
||||
else:
|
||||
print(in_lines[i], end="")
|
||||
if out_lines[i].startswith("Error, "):
|
||||
print("<e")
|
||||
else:
|
||||
print(out_lines[i], end="")
|
||||
|
||||
for i in range(len(in_lines), len(out_lines)):
|
||||
line = out_lines[i]
|
||||
if line.startswith("Error, "):
|
||||
print("<e")
|
||||
else:
|
||||
print(line, end="")
|
Loading…
Reference in New Issue
Block a user