mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-01 03:37:15 -06:00
47 lines
1.6 KiB
C++
47 lines
1.6 KiB
C++
#include "gtest/gtest.h"
|
|
|
|
#include "Summary/RiaSummaryStringTools.h"
|
|
|
|
#include <QString>
|
|
#include <QStringList>
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
TEST( RiaSummaryStringToolsTest, ParseNumbers )
|
|
{
|
|
QString wellFilter = "wopt:op_*";
|
|
QString fieldFilter = "fopt";
|
|
QStringList dataSourceNames = { "iter-1", "iter-22", "real-10", "real-11" };
|
|
|
|
{
|
|
QString dataSourceFilter = "iter-1";
|
|
QStringList arguments = { wellFilter, fieldFilter, dataSourceFilter };
|
|
|
|
QStringList addressFilters;
|
|
QStringList dataSourceFilters;
|
|
|
|
RiaSummaryStringTools::splitUsingDataSourceNames( arguments, dataSourceNames, addressFilters, dataSourceFilters );
|
|
|
|
EXPECT_TRUE( addressFilters[0] == wellFilter );
|
|
EXPECT_TRUE( addressFilters[1] == fieldFilter );
|
|
|
|
EXPECT_TRUE( dataSourceFilters[0] == dataSourceFilter );
|
|
}
|
|
|
|
{
|
|
QString dataSourceFilter = "iter-22:real-2*";
|
|
QStringList arguments = { wellFilter, fieldFilter, dataSourceFilter };
|
|
|
|
QStringList addressFilters;
|
|
QStringList dataSourceFilters;
|
|
|
|
RiaSummaryStringTools::splitUsingDataSourceNames( arguments, dataSourceNames, addressFilters, dataSourceFilters );
|
|
|
|
EXPECT_TRUE( addressFilters[0] == wellFilter );
|
|
EXPECT_TRUE( addressFilters[1] == fieldFilter );
|
|
|
|
EXPECT_TRUE( dataSourceFilters[0] == dataSourceFilter );
|
|
}
|
|
}
|