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

Tests the gaps between digit groups of numbers in code cells (GH #192). More...

#include <wx/app.h>
#include <wx/bitmap.h>
#include <wx/dcmemory.h>
#include <wx/log.h>
#include "CellPointers.h"
#include "Configuration.h"
#include "cells/EditorCell.h"
#include "cells/GroupCell.h"
#include <memory>
#include <catch2/catch.hpp>
Include dependency graph for test_EditorCellDigitGroups.cpp:

Data Structures

class  TestApp
 

Functions

 SCENARIO ("A long number in a code cell gets gaps, its text doesn't")
 
 SCENARIO ("The digits after a decimal point are grouped from the point on")
 
 SCENARIO ("Short numbers and names containing digits stay as they are")
 
 SCENARIO ("Switching grouping off removes the gaps")
 
 wxDECLARE_APP (TestApp)
 
int main (int argc, char **argv)
 

Detailed Description

Tests the gaps between digit groups of numbers in code cells (GH #192).

The gaps are drawn, never stored: m_text keeps the number exactly as typed, and every place that turns text into pixels – Recalculate(), Draw(), the caret (GetLineWidth()/PositionToPoint()), a click (SelectPointText()) and the selection rectangle – has to agree on where they are. Most checks here compare a cell with grouping on against the same cell with it off, which doesn't depend on which font the test machine has.

Windowless: real GroupCell/EditorCell against a memory-DC Configuration, no Worksheet, no wxFrame – the test_EditorCellTabs pattern.