WUT_Computer_Science/program/tests/test_code/test_split_rows.py

26 lines
622 B
Python
Raw Normal View History

2023-05-31 02:14:25 +02:00
from code.main import split_rows
def given_empty_then_correct():
assert split_rows("") == ['']
def given_no_slash_then_correct():
assert split_rows("estsegsegtswegseg") == ["estsegsegtswegseg"]
def given_double_slash_then_correct():
assert split_rows("\\") == ['', '']
def given_actual_string_then_correct():
actual_string = "test & 2 & test \\ 4 & 5 & 6"
assert split_rows(actual_string) == ["test & 2 & test ", " 4 & 5 & 6"]
def test_split_rows():
given_empty_then_correct()
given_no_slash_then_correct()
given_double_slash_then_correct()
given_actual_string_then_correct()