import pytest

from sapfo.taggedlist import ComboMode, FilterGroup, FilterTagItem, Parser


@pytest.mark.parametrize(
    ('text',),
    [('a, b',), (' a,b ',), (' a  ,b ',), ('a,  b',)])
def test_filter_tag_groups(text) -> None:
    parser = Parser(text, {}, {})
    assert parser.parse() == FilterGroup(
        combo_mode=ComboMode.AND,
        children=[FilterTagItem('a'), FilterTagItem('b')]
    )
