diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2021-06-17 13:18:36 +0430 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-06-17 18:44:00 +0430 |
commit | ac6a3d068d234793debf0b210dcffdfcfd928fd9 (patch) | |
tree | ec8fd0a7c7689aefb4c0a24aaa5c0a525af3e948 /Tests | |
parent | 2fe9c81b3049ef20193e9c88f424c0cd79c3dd26 (diff) | |
download | serenity-ac6a3d068d234793debf0b210dcffdfcfd928fd9.zip |
AK: Add some tests for hexdump formatting
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/AK/TestFormat.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Tests/AK/TestFormat.cpp b/Tests/AK/TestFormat.cpp index 266185a9d9..9e0aad7810 100644 --- a/Tests/AK/TestFormat.cpp +++ b/Tests/AK/TestFormat.cpp @@ -289,3 +289,11 @@ TEST_CASE(long_long_regression) EXPECT_EQ(builder.string_view(), "81985529216486895"); } + +TEST_CASE(hex_dump) +{ + EXPECT_EQ(String::formatted("{:hex-dump}", "0000"), "30303030"); + EXPECT_EQ(String::formatted("{:>4hex-dump}", "0000"), "30303030 0000"); + EXPECT_EQ(String::formatted("{:>2hex-dump}", "0000"), "3030 00\n3030 00"); + EXPECT_EQ(String::formatted("{:*>4hex-dump}", "0000"), "30303030****0000"); +} |