Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/TestTools.cpp')
-rw-r--r--tests/TestTools.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/TestTools.cpp b/tests/TestTools.cpp
index 4809a8bc9..cdce6e04e 100644
--- a/tests/TestTools.cpp
+++ b/tests/TestTools.cpp
@@ -72,10 +72,14 @@ void TestTools::testEnvSubstitute()
#if defined(Q_OS_WIN)
environment.insert("HOMEDRIVE", "C:");
environment.insert("HOMEPATH", "\\Users\\User");
+ environment.insert("USERPROFILE", "C:\\Users\\User");
QCOMPARE(Tools::envSubstitute("%HOMEDRIVE%%HOMEPATH%\\.ssh\\id_rsa", environment),
QString("C:\\Users\\User\\.ssh\\id_rsa"));
QCOMPARE(Tools::envSubstitute("start%EMPTY%%EMPTY%%%HOMEDRIVE%%end", environment), QString("start%C:%end"));
+ QCOMPARE(Tools::envSubstitute("%USERPROFILE%\\.ssh\\id_rsa", environment),
+ QString("C:\\Users\\User\\.ssh\\id_rsa"));
+ QCOMPARE(Tools::envSubstitute("~\\.ssh\\id_rsa", environment), QString("C:\\Users\\User\\.ssh\\id_rsa"));
#else
environment.insert("HOME", QString("/home/user"));
environment.insert("USER", QString("user"));