aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0xlt <94266259+w0xlt@users.noreply.github.com>2022-06-21 19:15:06 -0300
committerw0xlt <94266259+w0xlt@users.noreply.github.com>2022-06-21 19:19:31 -0300
commit67364ebe4c499eb8effe8dac11a5e3648f30c6c7 (patch)
tree1e947e1cbe463f848db44b371bdcf2186df1db05
parentace9af5688662a56d855bd26f36bc5c145b909e3 (diff)
test, qt: Add tests for `GUIUtil::extractFirstSuffixFromFilter`
-rw-r--r--src/qt/test/optiontests.cpp10
-rw-r--r--src/qt/test/optiontests.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/qt/test/optiontests.cpp b/src/qt/test/optiontests.cpp
index 3bd0af19ad..17ffeb220b 100644
--- a/src/qt/test/optiontests.cpp
+++ b/src/qt/test/optiontests.cpp
@@ -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");
+}
diff --git a/src/qt/test/optiontests.h b/src/qt/test/optiontests.h
index 286d785572..57ec8bd0f2 100644
--- a/src/qt/test/optiontests.h
+++ b/src/qt/test/optiontests.h
@@ -22,6 +22,7 @@ private Q_SLOTS:
void migrateSettings();
void integerGetArgBug();
void parametersInteraction();
+ void extractFilter();
private:
interfaces::Node& m_node;