mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 04:08:11 +00:00
AK+Format: Add support for integer to character casts.
Now the following is possible: outf("{:c}", 75); // K
This commit is contained in:
parent
f221a95a71
commit
1175ecf1dd
2 changed files with 48 additions and 3 deletions
|
@ -130,4 +130,10 @@ TEST_CASE(complex_string_specifiers)
|
|||
EXPECT_EQ(String::formatted("{:^9}", "abcd"), " abcd ");
|
||||
}
|
||||
|
||||
TEST_CASE(cast_integer_to_character)
|
||||
{
|
||||
EXPECT_EQ(String::formatted("{:c}", static_cast<int>('a')), "a");
|
||||
EXPECT_EQ(String::formatted("{:c}", static_cast<unsigned int>('f')), "f");
|
||||
}
|
||||
|
||||
TEST_MAIN(Format)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue