def METHOD_NAME(seg_list, caplog):
    """Test the Sequence grammar."""
    bs = StringParser("bar", KeywordSegment)
    fs = StringParser("foo", KeywordSegment)
    g = Sequence(bs, fs)
    # If running in the test environment, assert that Sequence recognises this
    if getenv("SQLFLUFF_TESTENV", ""):
        assert g.test_env
    gc = Sequence(bs, fs, allow_gaps=False)
    ctx = ParseContext(dialect=None)
    with caplog.at_level(logging.DEBUG, logger="sqlfluff.parser"):
        # Should be able to match the list using the normal matcher
        logging.info("#### TEST 1")
        m = g.match(seg_list, parse_context=ctx)
        assert m
        assert len(m) == 3
        assert m.matched_segments == (
            KeywordSegment("bar", seg_list[0].pos_marker),
            seg_list[1],  # This will be the whitespace segment
            KeywordSegment("foo", seg_list[2].pos_marker),
        )
        # Shouldn't with the allow_gaps matcher
        logging.info("#### TEST 2")
        assert not gc.match(seg_list, parse_context=ctx)
        # Shouldn't match even on the normal one if we don't start at the beginning
        logging.info("#### TEST 2")
        assert not g.match(seg_list[1:], parse_context=ctx)