def METHOD_NAME(dialect, segmentref, raw, caplog):
    """Test that specific segments parse as expected.
    NB: We're testing the PARSE function not the MATCH function
    although this will be a recursive parse and so the match
    function of SUBSECTIONS will be tested if present. The match
    function of the parent will not be tested.
    """
    config = FluffConfig(overrides=dict(dialect=dialect))
    seg_list = lex(raw, config=config)
    Seg = validate_segment(segmentref, config=config)
    # Most segments won't handle the end of file marker. We should strip it.
    if seg_list[-1].is_type("end_of_file"):
        seg_list = seg_list[:-1]
    # This test is different if we're working with RawSegment
    # derivatives or not.
    if isinstance(Seg, Matchable) or issubclass(Seg, RawSegment):
        print("Raw/Parser route...")
        ctx = ParseContext.from_config(config)
        with caplog.at_level(logging.DEBUG):
            parsed = Seg.match(segments=seg_list, parse_context=ctx)
        assert isinstance(parsed, MatchResult)
        assert len(parsed.matched_segments) == 1
        print(parsed)
        parsed = parsed.matched_segments[0]
        print(parsed)
    else:
        print("Base route...")
        # Construct an unparsed segment
        seg = Seg(seg_list, pos_marker=seg_list[0].pos_marker)
        # Perform the match (THIS IS THE MEAT OF THE TEST)
        ctx = ParseContext.from_config(config)
        with caplog.at_level(logging.DEBUG):
            result = seg.parse(parse_context=ctx)
        print(result)
        parsed = result[0]
        assert isinstance(parsed, Seg)
    # Check we get a good response
    print(parsed)
    print(type(parsed))
    print(type(parsed.raw))
    # Check we're all there.
    assert parsed.raw == raw
    # Check that there's nothing un parsable
    typs = parsed.type_set()
    assert "unparsable" not in typs