Commit ba0c6986 authored by Полина Соколова's avatar Полина Соколова
Browse files

Add new file

parent 8650a65b
No related merge requests found
Pipeline #99300 failed with stages
in 5 seconds
import subprocess
long_str = "itmo"*64
input_data = ["third_word", "second_word", "first_word", "ahahah",
long_str]
success_codes = ["WOWOWOW", "SIMPLE STRING IN HIGH REGISTER"
"simple string in low register","PUMPA and LUMPA", "", ""]
error_codes = ["", "", "", "No such word in the dict", "An error occurred while reading the string"]
path = "./my_program"
for i, test_input in enumerate(input_data):
process = subprocess.run(path, input=test_input, text=True, capture_output=True)
stdout = process.stdout.strip()
stderr = process.stderr.strip()
if stdout != success_codes[i]:
print(f"Test #{i+1} failed: got {stdout}, expected {success_codes[i]}")
elif stderr != error_codes[i]:
print(f"Test #{i+1} failed: got {stderr}, expected {error_codes[i]}")
else:
print(f"Test #{i+1} passed!")
# print(str_out)
# print(str_err)
print("===========================")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment