Refactor function structs into lambdas (#5675)

* change signature to use lambda

* reuse comparator

* inline structs in forEachCard

* inline structs

* Refactor exportDeckToDecklist

* fix unit test
This commit is contained in:
RickyRister 2025-04-19 21:07:22 -07:00 committed by GitHub
parent 1d259a86c1
commit 26dcb015ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 108 additions and 213 deletions

View file

@ -5,25 +5,20 @@
#include "gtest/gtest.h"
// using std types because qt types aren't understood by gtest (without this you'll get less nice errors)
using CardRows = QVector<std::pair<std::string, int>>;
struct Result
{
// using std types because qt types aren't understood by gtest (without this you'll get less nice errors)
using CardRows = QVector<std::pair<std::string, int>>;
std::string name;
std::string comments;
CardRows mainboard;
CardRows sideboard;
Result()
{
}
Result(std::string _name, std::string _comments, CardRows _mainboard, CardRows _sideboard)
: name(_name), comments(_comments), mainboard(_mainboard), sideboard(_sideboard)
{
}
void operator()(const InnerDecklistNode *innerDecklistNode, const DecklistCardNode *card);
};
void testEmpty(const QString &clipboard);