wxMaxima
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
test_LayoutInvariants.cpp File Reference

Layout idempotency invariants. More...

#include <wx/app.h>
#include <wx/bitmap.h>
#include <wx/dcmemory.h>
#include <wx/frame.h>
#include <wx/log.h>
#include "Configuration.h"
#include "MathParser.h"
#include "worksheet/Worksheet.h"
#include "cells/Cell.h"
#include "cells/GroupCell.h"
#include "cells/MatrCell.h"
#include <cstdlib>
#include <vector>
#include <unistd.h>
#include <catch2/catch.hpp>
Include dependency graph for test_LayoutInvariants.cpp:

Data Structures

struct  CellGeometry
 
class  TestApp
 

Functions

 SCENARIO ("Zoom change detected only via the config counter relayouts every nested cell")
 
 SCENARIO ("An app-style zoom (full tree reset) relayouts every nested cell")
 
 SCENARIO ("A narrow-wide canvas round trip restores the original layout")
 
 SCENARIO ("A special matrix with row/column names but no entries does not crash on draw")
 
 SCENARIO ("Nested fractions keep their reduced font sizes through partial break-ups")
 
 SCENARIO ("Editing operations on one cell do not visit the cells above it")
 
 wxDECLARE_APP (TestApp)
 
int main (int argc, char **argv)
 

Detailed Description

Layout idempotency invariants.

Guards against the recurring "cell marked valid with stale geometry" family of layout bugs (matrix column widths after a cancelled layout, ParenCell / ListCell spacing after zoom changes): after ANY sequence of configuration changes (zoom, canvas size), letting the layout converge must yield exactly the same geometry as laying out a freshly parsed copy of the same content under the final configuration. If any cell in the tree reports NeedsRecalculation()==false while holding geometry from an older configuration, the comparison fails and names the divergent cell.

The math content is parsed through the real MathParser from output captured from a live Maxima session (a list with subscripted variables, strings and hidden multiplications - the constructs from the 2026-07 layout bug reports), so the test exercises genuine nested ParenCell/ListCell trees.