mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-02 03:31:35 +02:00
qt, test: introduce FindInConsole function
Allows for regex searching into the console output.
This commit is contained in:
@ -21,6 +21,7 @@
|
||||
|
||||
#include <QAction>
|
||||
#include <QLineEdit>
|
||||
#include <QRegularExpression>
|
||||
#include <QScopedPointer>
|
||||
#include <QSignalSpy>
|
||||
#include <QTest>
|
||||
@ -30,6 +31,13 @@
|
||||
#include <QtTest/QtTestGui>
|
||||
|
||||
namespace {
|
||||
//! Regex find a string group inside of the console output
|
||||
QString FindInConsole(const QString& output, const QString& pattern)
|
||||
{
|
||||
const QRegularExpression re(pattern);
|
||||
return re.match(output).captured(1);
|
||||
}
|
||||
|
||||
//! Call getblockchaininfo RPC and check first field of JSON output.
|
||||
void TestRpcCommand(RPCConsole* console)
|
||||
{
|
||||
|
Reference in New Issue
Block a user