#6411 Import Ensemble : Windows-style network path not working as effective filter

This commit is contained in:
Magne Sjaastad committed 2020-09-02 14:22:38 +02:00
1 parent 27ee22f420
commit 3518a63347
2 files changed
+48 -6

No files matched your search

@@ -81,4 +81,34 @@ TEST( RiaFilePathTools, rootSearchPathFromSearchFilter )
QString resultRootPath = RiaFilePathTools::rootSearchPathFromSearchFilter( testPath );
EXPECT_EQ( QString( "//A/B[?]/E/" ), resultRootPath );
}
}
}
//--------------------------------------------------------------------------------------------------
TEST( RiaFilePathTools, removeDuplicatePathSeparators )
{
{
QString testPath( "//myshare/folder-a/folder-b/" );
QString resultRootPath = RiaFilePathTools::removeDuplicatePathSeparators( testPath );
EXPECT_STRCASEEQ( testPath.toLatin1(), resultRootPath.toLatin1() );
}
{
QString testPath( "//myshare/folder-a//folder-b/" );
QString expectedPath( "//myshare/folder-a/folder-b/" );
QString resultRootPath = RiaFilePathTools::removeDuplicatePathSeparators( testPath );
EXPECT_STRCASEEQ( expectedPath.toLatin1(), resultRootPath.toLatin1() );
}
{
QString testPath( R"(\\myshare\folder-a\folder-b\)" );
QString resultRootPath = RiaFilePathTools::removeDuplicatePathSeparators( testPath );
EXPECT_STRCASEEQ( testPath.toLatin1(), resultRootPath.toLatin1() );
}
{
QString testPath( R"(\\myshare\folder-a\\folder-b\\)" );
QString expectedPath( R"(\\myshare\folder-a\folder-b\)" );
QString resultRootPath = RiaFilePathTools::removeDuplicatePathSeparators( testPath );
EXPECT_STRCASEEQ( expectedPath.toLatin1(), resultRootPath.toLatin1() );
}
}