keepassxc icon indicating copy to clipboard operation
keepassxc copied to clipboard

Run tests with LANG=en_US.UTF-8

Open c4rlo opened this issue 2 years ago • 4 comments

On my system, I have LANG=en_GB set, which causes the following test failure:

FAIL!  : TestCli::testInfo() Compared values are not the same
   Actual   (m_stdout->readLine())                                  : "Average password length: 11 character(s)\n"
   Expected (QByteArray("Average password length: 11 characters\n")): "Average password length: 11 characters\n"
   Loc: [tests/TestCli.cpp(876)]

And it so happens that the en_GB translation of that string has 'character(s)' where en_US has 'characters'.

Type of change

  • ✅ Bug fix (non-breaking change that fixes an issue)

c4rlo avatar Apr 03 '22 19:04 c4rlo

Codecov Report

Merging #7780 (319f4c1) into develop (31db3c3) will increase coverage by 0.03%. The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop    #7780      +/-   ##
===========================================
+ Coverage    64.29%   64.32%   +0.03%     
===========================================
  Files          339      339              
  Lines        43429    43429              
===========================================
+ Hits         27920    27933      +13     
+ Misses       15509    15496      -13     
Impacted Files Coverage Δ
src/core/Entry.cpp 82.86% <0.00%> (+0.20%) :arrow_up:
src/fdosecrets/dbus/DBusMgr.cpp 53.67% <0.00%> (+1.47%) :arrow_up:
...rc/fdosecrets/widgets/SettingsWidgetFdoSecrets.cpp 59.09% <0.00%> (+3.03%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 31db3c3...319f4c1. Read the comment docs.

codecov-commenter avatar Apr 03 '22 19:04 codecov-commenter

This may also fix #7747 .

michaelk83 avatar Apr 03 '22 20:04 michaelk83

This is also a bug in the en_GB locale apparently, which should not have the "(s)" at the end.

phoerious avatar Apr 04 '22 08:04 phoerious

I ran into similar problem when trying to run the tests on a system with fi_FI locale (of course there are many more differences between actual and expected strings). Also #7747, and yet another failure in testmerge whose cause remains unclear to me. This pull request fixes all these issues.

oturpe avatar Sep 17 '22 20:09 oturpe