mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-26 00:06:49 -06:00
26 lines
657 B
C++
26 lines
657 B
C++
#include "gtest/gtest.h"
|
|
|
|
#include "RiaStdStringTools.h"
|
|
|
|
#include <QLocale>
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
TEST( RiaStdStringToolsTest, ParseNumbers )
|
|
{
|
|
auto decimalPoint = QLocale::c().decimalPoint().toLatin1();
|
|
|
|
{
|
|
std::string text = "8.73705e+06";
|
|
|
|
EXPECT_TRUE( RiaStdStringTools::isNumber( text, decimalPoint ) );
|
|
}
|
|
|
|
{
|
|
std::string text = "-8.73705e-06";
|
|
|
|
EXPECT_TRUE( RiaStdStringTools::isNumber( text, decimalPoint ) );
|
|
}
|
|
}
|