tests/test_buffer.py::TestCreation currently only asserts len(buf) after add_str / add because the Buffer has no way to read codepoints back out. Once Font.shape() lands (Phase 4→5), known-input strings shaped against a known-input font should produce a deterministic glyph run — that's the real regression signal, not the codepoint count.
What to do when Phase 5 is in:
- For a couple of representative inputs (ASCII, Arabic, astral plane, empty), shape against a bundled font and assert the full
serialize() output.
- Delete the length-only tests whose coverage is now subsumed (
test_add_str_ascii, test_add_str_multi_bmp, test_add_str_astral, test_add_str_multiple_calls_append), or keep one as a quick smoke test.
- Keep
test_add_codepoint (exercises the add(codepoint, cluster) path specifically) but extend it to verify the cluster values survive shaping.
Why it matters: right now we're only proving that push_str doesn't drop characters. We're not proving that text actually reaches the shaper correctly — a bug that silently corrupted buffer contents would slip through these tests.
tests/test_buffer.py::TestCreationcurrently only assertslen(buf)afteradd_str/addbecause theBufferhas no way to read codepoints back out. OnceFont.shape()lands (Phase 4→5), known-input strings shaped against a known-input font should produce a deterministic glyph run — that's the real regression signal, not the codepoint count.What to do when Phase 5 is in:
serialize()output.test_add_str_ascii,test_add_str_multi_bmp,test_add_str_astral,test_add_str_multiple_calls_append), or keep one as a quick smoke test.test_add_codepoint(exercises theadd(codepoint, cluster)path specifically) but extend it to verify the cluster values survive shaping.Why it matters: right now we're only proving that
push_strdoesn't drop characters. We're not proving that text actually reaches the shaper correctly — a bug that silently corrupted buffer contents would slip through these tests.