tst_QFileInfo::stdfilesystem: add extra Unicode string tests

Change-Id: I2b24e1d3cad44897906efffd17803f70bd4d60f6
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 5b9e2f31bd4bc636cf596ef3375317f33041cad5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Thiago Macieira 2023-08-30 12:20:13 -07:00 committed by Qt Cherry-pick Bot
parent 6c6653719e
commit 9e1eb7ff69

View File

@ -2329,6 +2329,18 @@ void tst_QFileInfo::stdfilesystem()
COMPARE_CONSTRUCTION("./filæ.txt");
#endif
// Test unicode strings
QCOMPARE(QFileInfo(fs::path(u"./filæ.txt")).absoluteFilePath(),
QFileInfo(u"./filæ.txt"_s).absoluteFilePath());
QCOMPARE(QFileInfo(base, fs::path(u"./filæ.txt")).absoluteFilePath(),
QFileInfo(base, u"./filæ.txt"_s).absoluteFilePath());
#ifdef __cpp_char8_t
QCOMPARE(QFileInfo(fs::path(u8"./filæ.txt")).absoluteFilePath(),
QFileInfo(u8"./filæ.txt").absoluteFilePath());
QCOMPARE(QFileInfo(base, fs::path(u8"./filæ.txt")).absoluteFilePath(),
QFileInfo(base, u8"./filæ.txt").absoluteFilePath());
#endif
#undef COMPARE_CONSTRUCTION
{
// One proper comparison with operator== for each ctor