0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-05 14:06:27 -05:00

test, qt: Add tests for GUIUtil::extractFirstSuffixFromFilter

This commit is contained in:
w0xlt 2022-06-21 19:15:06 -03:00
parent ace9af5688
commit 67364ebe4c
2 changed files with 11 additions and 0 deletions

View file

@ -4,6 +4,7 @@
#include <init.h>
#include <qt/bitcoin.h>
#include <qt/guiutil.h>
#include <qt/test/optiontests.h>
#include <test/util/setup_common.h>
#include <util/system.h>
@ -122,3 +123,12 @@ void OptionTests::parametersInteraction()
QVERIFY(!settings.contains("fListen"));
gArgs.ClearPathCache();
}
void OptionTests::extractFilter()
{
QString filter = QString("Partially Signed Transaction (Binary) (*.psbt)");
QCOMPARE(GUIUtil::ExtractFirstSuffixFromFilter(filter), "psbt");
filter = QString("Image (*.png *.jpg)");
QCOMPARE(GUIUtil::ExtractFirstSuffixFromFilter(filter), "png");
}

View file

@ -22,6 +22,7 @@ private Q_SLOTS:
void migrateSettings();
void integerGetArgBug();
void parametersInteraction();
void extractFilter();
private:
interfaces::Node& m_node;