def test_rule_str(): assert str(Rule('ALPHA')) == "Rule('ALPHA')"
def test_WSP(src): node, start = Rule('WSP').parse(src, 0) assert node and node.value == src
def test_rule_undefined(): with pytest.raises(GrammarError): Rule('undefined').parse('x', 0)
def test_VCHAR(src): node, start = Rule('VCHAR').parse(src, 0) assert node and node.value == src
def test_ALPHA(src): node, start = Rule('ALPHA').parse(src, 0) assert node and node.value == src
def test_LF(src): node, start = Rule('LF').parse(src, 0) assert node and node.value == src
def test_OCTET(src): node, start = Rule('OCTET').parse(src, 0) assert node and node.value == src
def test_HTAB(src): node, start = Rule('HTAB').parse(src, 0) assert node and node.value == src
def test_HEXDIG(src): node, start = Rule('HEXDIG').parse(src, 0) assert node and node.value == src
def test_DQUOTE(src): node, start = Rule('DQUOTE').parse(src, 0) assert node and node.value == src
def test_DIGIT(src): node, start = Rule('DIGIT').parse(src, 0) assert node and node.value == src
def test_CTL(src): node, start = Rule('CTL').parse(src, 0) assert node and node.value == src