def METHOD_NAME(keyword, seg_list, slice_len, fresh_ansi_dialect):
    """Test the GreedyUntil grammar."""
    grammar = GreedyUntil(StringParser(keyword, KeywordSegment))
    ctx = ParseContext(dialect=fresh_ansi_dialect)
    assert (
        grammar.match(seg_list, parse_context=ctx).matched_segments
        == seg_list[:slice_len]
    )