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

Pins Worksheet::AnonymizeCodeCells() (GH #1339): replacing every non-builtin variable/function name in the selected code cells with a random, collision-free, reproducible-within-the-run replacement, leaving Maxima builtins, the tokenizer's hardcoded keywords (for/then/do/...), string/number literals and non-code cells untouched, all as one undo step. 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 "MaximaTokenizer.h"
#include "worksheet/Worksheet.h"
#include "cells/EditorCell.h"
#include "cells/GroupCell.h"
#include "cells/TextCell.h"
#include <catch2/catch.hpp>
Include dependency graph for test_AnonymizeCodeCells.cpp:

Data Structures

class  TestApp
 

Functions

 SCENARIO ("AnonymizeCodeCells renames non-builtin names consistently")
 
 SCENARIO ("AnonymizeCodeCells leaves Maxima builtins and syntax keywords alone")
 
 SCENARIO ("AnonymizeCodeCells uses the same replacement across multiple cells")
 
 SCENARIO ("AnonymizeCodeCells only touches code cells, and only within the selection")
 
 SCENARIO ("AnonymizeCodeCells groups all its edits into a single undo step")
 
 SCENARIO ("AnonymizeCodeCells does nothing when nothing needs renaming")
 
 wxDECLARE_APP (TestApp)
 
int main (int argc, char **argv)
 

Detailed Description

Pins Worksheet::AnonymizeCodeCells() (GH #1339): replacing every non-builtin variable/function name in the selected code cells with a random, collision-free, reproducible-within-the-run replacement, leaving Maxima builtins, the tokenizer's hardcoded keywords (for/then/do/...), string/number literals and non-code cells untouched, all as one undo step.

These scenarios always select the cells to anonymize, deliberately never exercising the "nothing selected -> ask the user" confirmation dialog: a real modal dialog can't be driven headlessly here, so that path is verified manually instead (see AGENTS.md).