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 <wx/filename.h>
#include "Configuration.h"
#include "MathParser.h"
#include "worksheet/Worksheet.h"
#include "cells/Cell.h"
#include "cells/GroupCell.h"
#include "cells/MatrCell.h"
#include "cells/LongNumberCell.h"
#include "cells/ProductCell.h"
#include "cells/SetCell.h"
#include "cells/ImgCellBase.h"
#include "cells/MatrixScrollHost.h"
#include "worksheet/MatrixScrollbars.h"
#include <wx/region.h>
#include <wx/scrolwin.h>
#include <wx/dcgraph.h>
#include <wx/graphics.h>
#include <cstdlib>
#include <vector>
#include <catch2/catch.hpp>
Include dependency graph for test_LayoutInvariants.cpp:

Data Structures

struct  CellGeometry
 
class  OversizedMatricesMode
 
class  FakeScrollHost
 
class  ScrollModeWithHost
 
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 ("Nothing inside a subscript is broken into lines")
 
 SCENARIO ("Editing operations on one cell do not visit the cells above it")
 
 SCENARIO ("A SetCell positions its brace and content cells (GH #2270)")
 
 SCENARIO ("A SetCell's LaTeX export escapes its braces (GH #2282)")
 
 SCENARIO ("A ProductCell positions its symbol/limits/base and breaks up with the right command name")
 
 SCENARIO ("A linear power has no gap between its caret and its exponent")
 
 SCENARIO ("Output numbers get gaps between their digit groups, on screen only (GH #192)")
 
 SCENARIO ("A matrix too wide for the window is elided unless shown in full")
 
 SCENARIO ("A matrix whose first column alone is too wide shows only the dots (GH #2438)")
 
 SCENARIO ("A matrix too tall for the window leaves out middle rows")
 
 SCENARIO ("A matrix too large for the window can scroll in a viewport")
 
 SCENARIO ("A scrolled matrix draws an entry that starts left of the worksheet")
 
 SCENARIO ("An oversized matrix nested in another one")
 
 SCENARIO ("Hovering over a matrix says which row and column the mouse is over")
 
 SCENARIO ("Without a scrollbar host, scroll mode elides instead")
 
 SCENARIO ("wx_matrix()'s oversized option overrides the configuration (GH #2343)")
 
 SCENARIO ("The worksheet's matrix scrollbars follow the matrices they belong to")
 
 SCENARIO ("A repaint of just a scrolling matrix's vertical scrollbar still draws it")
 
 SCENARIO ("Only a matrix too large for the window gets alternating bands")
 
 SCENARIO ("wx_matrix()'s banding option forces bands on or off")
 
 wxDECLARE_APP (TestApp)
 
 SCENARIO ("A hidden multiplication sign at a line break is drawn (GH #2263)")
 
 SCENARIO ("A plot's scale attribute reaches the image and survives ToXML()")
 
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.