from nltk.tokenize import word_tokenize

from srs2std.evaluate.factcheck_strategies.scorers.scorer import generate_chunks


def test_generate_chunks():
    text_list = [
        "This is the 1st sentence.",
        "This is the 2nd sentence.",
        "This is the 3rd sentence.",
        "This is the 4th sentence.",
    ]
    text = " ".join(text_list)
    chunk_size = len(word_tokenize(text_list[0])) + 1

    expected = text_list
    actual = list(generate_chunks(text, chunk_size))
    assert actual == expected
