Commit de5476a4 authored by Adriaan de Groot's avatar Adriaan de Groot 💬 Committed by Albert Astals Cid
Browse files

autotests: repair long-format tests

In KCoreAddons dc48123f6, a timeFormatType was introduced in
KFormatPrivate::formatRelativeDateTime() which maps LongFormat
to ShortFormat; this means that trailing seconds and timezone
are no longer shown. Adjust the regexes in Baloo to chase
that change.
parent 0bb85719
Pipeline #165916 passed with stage
in 49 seconds
......@@ -92,10 +92,10 @@ void FileMetadataDateDisplayTest::shouldDisplayLongAndShortDates_data()
QTest::addRow("Long date, long ago")
<< Baloo::DateFormats::LongFormat << QUrl::fromLocalFile(QFINDTESTDATA("samplefiles/testtagged.mp3"))
<< QRegularExpression(
QStringLiteral("[A-Z][a-z]+, [A-Z][a-z]+ (?:[1-3][0-9]|[1-9]), 20[0-9]{2} (?:1[0-2]|[1-9]):[0-5][0-9]:[0-5][0-9] [AP]M [A-Z]{3,4}"));
QStringLiteral("[A-Z][a-z]+, [A-Z][a-z]+ (?:[1-3][0-9]|[1-9]), 20[0-9]{2} at (?:1[0-2]|[1-9]):[0-5][0-9] [AP]M"));
QTest::addRow("Long date, yesterday") << Baloo::DateFormats::LongFormat << QUrl::fromLocalFile(QFINDTESTDATA("samplefiles/testtagged.m4a"))
<< QRegularExpression(QStringLiteral("Yesterday, (?:1[0-2]|[1-9]):[0-5][0-9]:[0-5][0-9] [AP]M [A-Z]{3,4}"));
<< QRegularExpression(QStringLiteral("Yesterday at (?:1[0-2]|[1-9]):[0-5][0-9] [AP]M"));
}
void FileMetadataDateDisplayTest::shouldDisplayLongAndShortDates()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment