def test_grammar_rule(): assert Grammar._prepare_product('FdSD') == ['F', 'd', 'SD'] assert Grammar._prepare_product('WORD') == ['WORD'] assert Grammar._prepare_product('12 34') == ['1', '2', '3', '4'] assert Grammar._prepare_product('a b c') == ['a', 'b', 'c'] assert Grammar._prepare_product('H D F') == ['H', 'D', 'F'] assert Grammar._prepare_product(' U ij') == ['U', 'i', 'j'] assert Grammar._prepare_product(GRAMMAR_EPSILON) == []