From 6b3b2b41f157dc2e010b91e9540f28e8e3ca4dc0 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 7 Nov 2024 08:55:42 +0100 Subject: [PATCH] FilePath: Add missing tests Change-Id: Ia533dbf09e6ae1cfc1ceead60f296d4c64efda22 Reviewed-by: hjk --- tests/auto/utils/filepath/tst_filepath.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/auto/utils/filepath/tst_filepath.cpp b/tests/auto/utils/filepath/tst_filepath.cpp index 8f991be291c..ce390d6ebea 100644 --- a/tests/auto/utils/filepath/tst_filepath.cpp +++ b/tests/auto/utils/filepath/tst_filepath.cpp @@ -1819,6 +1819,18 @@ void tst_filepath::dontBreakPathOnWierdWindowsPaths() path.toString(), "device://host/C:/Users/ckandeler/Documents/" "build-iartest-IAR-Debugx/Debug_IAR_55df6f02d5b3d06d/iartest.a152245e/iartest.out"); + + // Make sure the optimization still works + FilePath path2 = FilePath::fromString("/./"); + QCOMPARE(path2.toString(), ""); + + // Make sure unix paths are not affected + FilePath path3 = FilePath::fromString("/./foo/bar"); + QCOMPARE(path3.toString(), "foo/bar"); + + // Make sure unix paths with device also work + FilePath path4 = FilePath::fromString("device://host/./foo/bar"); + QCOMPARE(path4.toString(), "device://host/./foo/bar"); } } // Utils