test(reading): propagate Allium specification tests for Knuth-Plass rendering pipeline

Formalize the behavioral specification for off-thread Knuth-Plass text
chunk layout and virtualized QML rendering in specs/knuth-plass-rendering.allium,
and introduce a test suite covering all 66 specification obligations across
value types, state machine transitions, invariants, and surface contracts.

To satisfy the specification's precondition and invariant contracts:
- Validate and clamp initial restore chunk bounds when opening documents
  in ReadingModel to ensure anchor chunks remain strictly within bounds.
- Guard scroll position updates against negative and out-of-bounds chunk
  indices to honor the ScrollPositionChanged preconditions.
- Emit positionSaved on publisher color toggles to fulfill the
  PositionPersisted contract without triggering unnecessary relayouts.
- Register KnuthPlassRenderingSpecTest in CMakeLists.txt and document the
  spec and test hierarchy in AGENTS.md.
This commit is contained in:
Agel committed 2026-10-29 15:18:14 +01:00
1 parent 306d4cac5c
commit 3ff861a2a0
5 files changed
+1717 -3

No files matched your search

+14
View File
@@ -332,6 +332,20 @@ add_asteria_test(ReadingModelTest tests/ReadingModelTest.cpp
target_link_libraries(ReadingModelTest PRIVATE Qt6::Gui Qt6::Concurrent Qt6::Quick PkgConfig::MINIZIP PkgConfig::LIBARCHIVE Qt6::Xml Qt6::Network)
set_tests_properties(ReadingModelTest PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=offscreen")
add_asteria_test(KnuthPlassRenderingSpecTest tests/reading/KnuthPlassRenderingSpecTest.cpp
src/backend/ReadingModel.cpp
src/backend/reading/MangaPagination.cpp
src/backend/reading/KnuthPlassItem.cpp
src/backend/formats/AsyncImageResponse.cpp
src/backend/formats/FormatRegistry.cpp
src/backend/AppState.cpp
src/backend/state/BookPositionStore.cpp
src/backend/HistoryModel.cpp
${COMIC_SOURCES}
${EPUB_READER_SOURCES})
target_link_libraries(KnuthPlassRenderingSpecTest PRIVATE Qt6::Gui Qt6::Concurrent Qt6::Quick PkgConfig::MINIZIP PkgConfig::LIBARCHIVE Qt6::Xml Qt6::Network)
set_tests_properties(KnuthPlassRenderingSpecTest PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=offscreen")
add_asteria_test(AppStateTest tests/AppStateTest.cpp
src/backend/AppState.cpp)