From 4bfd394384f06a791dd1221841d7c404e27aac62 Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Thu, 8 Apr 2021 18:50:25 +0200 Subject: Tests: Merge duplicate TestFormat test into AK directory --- AK/Tests/TestFormat.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'AK') 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) -- cgit v1.2.3