Fix display of bytes without decimals (#10595)

*Fixes #10594
This commit is contained in:
meigelb 2024-04-25 00:20:58 +02:00 committed by Jonathan White
parent 381eb76f7b
commit 417bc29bc8
No known key found for this signature in database
GPG key ID: 440FC65F2E0C6E01
3 changed files with 5 additions and 3 deletions

View file

@ -38,7 +38,7 @@ void TestTools::testHumanReadableFileSize()
constexpr auto kibibyte = 1024u;
using namespace Tools;
QCOMPARE(createDecimal("1", "00", "B"), humanReadableFileSize(1));
QCOMPARE(QString("1 B"), humanReadableFileSize(1));
QCOMPARE(createDecimal("1", "00", "KiB"), humanReadableFileSize(kibibyte));
QCOMPARE(createDecimal("1", "00", "MiB"), humanReadableFileSize(kibibyte * kibibyte));
QCOMPARE(createDecimal("1", "00", "GiB"), humanReadableFileSize(kibibyte * kibibyte * kibibyte));