def test_single_character(): assert to_postfix('^a$') == as_list_of_tokens('a')
def test_mixed_operators(): with pytest.raises(MalformedRegex): to_postfix('???+*+++**?')
def test_incorred_mixed_operators_and_characters(): with pytest.raises(MalformedRegex): to_postfix('a+???a+bc**')
def test_one_character_question_mark(): assert to_postfix('^a?$') == as_list_of_tokens('a?')
def test_three_plus_operators(): with pytest.raises(MalformedRegex): to_postfix('+++')
def test_four_characters(): assert to_postfix('^abcd$') == as_list_of_tokens('ab.c.d.')
def test_one_character_star(): assert to_postfix('^a*$') == as_list_of_tokens('a*')
def test_incorrect_expression_in_parenthesis(): with pytest.raises(MalformedRegex): to_postfix('^a(+++)b$')
def test_simple_alt(): assert to_postfix('^a|b$') == as_list_of_tokens('ab|')
def test_parenthesis_plus(): assert to_postfix('^a(bc)+$') == as_list_of_tokens('abc.+.')
def test_folded_parenthesis(): assert to_postfix('^a(b+(cd)+)$') == as_list_of_tokens('ab+cd.+..')
def test_redundant_parenthesis(): assert to_postfix('^a(b)$') == as_list_of_tokens('ab.')
def test_three_characters_with_pluses(): assert to_postfix('^a+b+c+$') == as_list_of_tokens('a+b+.c+.')
def test_one_character_question_mark_in_the_middle(): assert to_postfix('^ab?c$') == as_list_of_tokens('ab?.c.')
def test_two_characters(): assert to_postfix('^ab$') == as_list_of_tokens('ab.')
def test_alt_with_plus(): assert to_postfix('^a+|b+$') == as_list_of_tokens('a+b+|')
def test_three_characters(): assert to_postfix('^abc$') == as_list_of_tokens('ab.c.')
def test_alt_with_groups(): assert to_postfix('^(abc)|(cde)$') == as_list_of_tokens('ab.c.cd.e.|')
def test_one_character_plus(): assert to_postfix('^a+$') == as_list_of_tokens('a+')
def test_plus_operator_only(): with pytest.raises(MalformedRegex): to_postfix('+')
def test_character_plus_in_the_middle(): assert to_postfix('^ab+c$') == as_list_of_tokens('ab+.c.')
def test_character_star_in_the_middle(): assert to_postfix('^ab*c$') == as_list_of_tokens('ab*.c.')