diff options
author | Jelle Raaijmakers <jelle@gmta.nl> | 2021-04-08 18:50:25 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-08 20:30:56 +0200 |
commit | 4bfd394384f06a791dd1221841d7c404e27aac62 (patch) | |
tree | 2a892bded128d4e7dda9fd09f5bee597d5d06e76 /AK | |
parent | 18b333473804756214509e4d5143415a7f3332ee (diff) | |
download | serenity-4bfd394384f06a791dd1221841d7c404e27aac62.zip |
Tests: Merge duplicate TestFormat test into AK directory
Diffstat (limited to 'AK')
-rw-r--r-- | AK/Tests/TestFormat.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/AK/Tests/TestFormat.cpp b/AK/Tests/TestFormat.cpp index 8113f957dc..a6a4c0b03a 100644 --- a/AK/Tests/TestFormat.cpp +++ b/AK/Tests/TestFormat.cpp @@ -294,4 +294,15 @@ TEST_CASE(use_format_string_formatter) EXPECT_EQ(String::formatted("{:*<10}", C { 42 }), "C(i=42)***"); } +TEST_CASE(long_long_regression) +{ + EXPECT_EQ(String::formatted("{}", 0x0123456789abcdefLL), "81985529216486895"); + + StringBuilder builder; + AK::FormatBuilder fmtbuilder { builder }; + fmtbuilder.put_i64(0x0123456789abcdefLL); + + EXPECT_EQ(builder.string_view(), "81985529216486895"); +} + TEST_MAIN(Format) |