mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
AK+Tests: Add a test for formatting numbers in base 10 units
Added a test case to TestNumberFormat to test the new base 10 formatting capability
This commit is contained in:
parent
0dbb1be81c
commit
0105600120
Notes:
sideshowbarker
2024-07-17 11:34:34 +09:00
Author: https://github.com/kuzux Commit: https://github.com/SerenityOS/serenity/commit/0105600120 Pull-request: https://github.com/SerenityOS/serenity/pull/16410 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/LucasChollet Reviewed-by: https://github.com/ldm5180
1 changed files with 8 additions and 0 deletions
|
@ -125,3 +125,11 @@ TEST_CASE(extremes_8byte)
|
|||
warnln("(Skipping 8-byte-size_t test on 32-bit platform)");
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE(base10_units)
|
||||
{
|
||||
EXPECT_EQ(human_readable_size(999, AK::HumanReadableBasedOn::Base10), "999 B");
|
||||
EXPECT_EQ(human_readable_size(1024, AK::HumanReadableBasedOn::Base10), "1.0 KB");
|
||||
EXPECT_EQ(human_readable_size(1100, AK::HumanReadableBasedOn::Base10), "1.1 KB");
|
||||
EXPECT_EQ(human_readable_size(1000000, AK::HumanReadableBasedOn::Base10), "1.0 MB");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue