File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 1212#include < qt/rpcconsole.h>
1313#include < shutdown.h>
1414#include < test/util/setup_common.h>
15- #include < univalue.h>
1615#include < validation.h>
1716
1817#if defined(HAVE_CONFIG_H)
2423#include < QRegularExpression>
2524#include < QScopedPointer>
2625#include < QSignalSpy>
26+ #include < QString>
2727#include < QTest>
2828#include < QTextEdit>
2929#include < QtGlobal>
@@ -49,10 +49,9 @@ void TestRpcCommand(RPCConsole* console)
4949 QTest::keyClick (lineEdit, Qt::Key_Return);
5050 QVERIFY (mw_spy.wait (1000 ));
5151 QCOMPARE (mw_spy.count (), 4 );
52- QString output = messagesWidget->toPlainText ();
53- UniValue value;
54- value.read (output.right (output.size () - output.lastIndexOf (QChar::ObjectReplacementCharacter) - 1 ).toStdString ());
55- QCOMPARE (value[" chain" ].get_str (), std::string (" regtest" ));
52+ const QString output = messagesWidget->toPlainText ();
53+ const QString pattern = QStringLiteral (" \" chain\" : \" (\\ w+)\" " );
54+ QCOMPARE (FindInConsole (output, pattern), QString (" regtest" ));
5655}
5756} // namespace
5857
You can’t perform that action at this time.
0 commit comments