D28406: Fix sonnet autodetect test failure
Waqar Ahmed
noreply at phabricator.kde.org
Sun Mar 29 20:41:59 BST 2020
waqar added a comment.
In D28406#637359 <https://phabricator.kde.org/D28406#637359>, @dfaure wrote:
> I'm no expert in this stuff, but here's my feedback
>
> 1. on my own system (!= CI), all three tests were failing before, due to finding en_AU-variant_1, en_AU-variant_1 and "".
> 2. now the test passes locally, but because all tests are skipped SKIP : SonnetAutoDetectTest::autodetect(English) en_US-large not available SKIP : SonnetAutoDetectTest::autodetect(German) de_DE_frami not available SKIP : SonnetAutoDetectTest::autodetect(Malayam) ml_IN not available What's en_US-large? Can we at least check that we get en_US-*?
en_US-large is the US English dictionary name, the most common one available in most distros according to my findings. Looking for en_US-*/en_US* would still make the test fail. I have both ASpell and Hunspell installed on my system, so i have quite a large list of English dictionaries available. Every time I run the test, it autodetects a different variant of 'English' i.e., en_AU-variant_1/ en_US / en_GB. So, to make the test pass, I chopped the string and retrieved the language code only and used that for comparison. For e.g, for en_US -> en is the language code.
The tests are currently failing because it was unable to find any en_US/de_DE_frami in the dictionaries because of:
if (!speller.availableLanguages().contains(correct_lang)) {
const QString msg = correct_lang + QStringLiteral(" not available");
QSKIP(msg.toLocal8Bit().constData());
}
but perhaps we can get around it using regex
REPOSITORY
R246 Sonnet
REVISION DETAIL
https://phabricator.kde.org/D28406
To: waqar
Cc: dfaure, kde-frameworks-devel, LeGast00n, cblack, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200329/b4738269/attachment.html>
More information about the Kde-frameworks-devel
mailing list