mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-07-04 22:43:11 +02:00
26 lines
622 B
Python
26 lines
622 B
Python
|
|
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()
|