from placeholder_utils import (
    placeholder_paragraph,
    placeholder_sentences,
    placeholder_words,
)


def test_words_respects_count_and_seed():
    text = placeholder_words(4, seed=1)
    assert len(text.split()) == 4
    assert text == placeholder_words(4, seed=1)


def test_paragraph_wraps_and_is_deterministic():
    wrapped = placeholder_paragraph(sentences=2, width=20, seed=5)
    assert wrapped == placeholder_paragraph(sentences=2, width=20, seed=5)
    assert all(len(line) <= 20 for line in wrapped.splitlines())


def test_sentences_count():
    text = placeholder_sentences(sentences=3, seed=2)
    assert text.count(".") == 3


def test_invalid_inputs_raise():
    import pytest

    with pytest.raises(ValueError):
        placeholder_words(0)
    with pytest.raises(ValueError):
        placeholder_sentences(0)
    with pytest.raises(ValueError):
        placeholder_paragraph(1, width=5)

