Files
ResInsight/ApplicationLibCode/UnitTests/RimTools-Test.cpp
T
Magne Sjaastad edc9cec0a4 Add relocatePathPattern
Remove unused code from relocateFile
2025-05-26 11:17:53 +02:00

21 lines
778 B
C++

#include "gtest/gtest.h"
#include "RimTools.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
TEST( RimToolsTest, ReplacePathPattern )
{
QString previousProjectPath = "C:/path/to/projectFileFolder";
QString realization = "realization-*/MY_CASE-*";
QString originalPattern = "C:/path/to/" + realization;
QString newProjectPath = "/mnt/new/path/to/projectFileFolder";
QString expectedPattern = "/mnt/new/path/to/" + realization;
QString resultPattern = RimTools::relocatePathPattern( originalPattern, newProjectPath, previousProjectPath );
EXPECT_EQ( resultPattern, expectedPattern );
}