mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-11 03:56:16 +00:00
AK: Replace wchar_t formatting with char32_t
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
This makes TestFormat fully cross-platform as we no longer have to work around the 16 vs 32-bit wide strings
This commit is contained in:
parent
7f0f513159
commit
5f5ae6bf8b
Notes:
github-actions[bot]
2025-05-19 01:19:15 +00:00
Author: https://github.com/ayeteadoe
Commit: 5f5ae6bf8b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4789
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/gmta
3 changed files with 15 additions and 14 deletions
|
@ -397,16 +397,17 @@ TEST_CASE(vector_format)
|
|||
}
|
||||
}
|
||||
|
||||
TEST_CASE(format_wchar)
|
||||
TEST_CASE(format_utf32)
|
||||
{
|
||||
EXPECT_EQ(ByteString::formatted("{}", L'a'), "a");
|
||||
EXPECT_EQ(ByteString::formatted("{}", L'\U0001F41E'), "\xF0\x9F\x90\x9E");
|
||||
EXPECT_EQ(ByteString::formatted("{:x}", L'a'), "61");
|
||||
EXPECT_EQ(ByteString::formatted("{:x}", L'\U0001F41E'), "1f41e");
|
||||
EXPECT_EQ(ByteString::formatted("{:d}", L'a'), "97");
|
||||
EXPECT_EQ(ByteString::formatted("{:d}", L'\U0001F41E'), "128030");
|
||||
EXPECT_EQ(ByteString::formatted("{}", U'a'), "a");
|
||||
EXPECT_EQ(ByteString::formatted("{}", U'\U0001F41E'), "\xF0\x9F\x90\x9E");
|
||||
EXPECT_EQ(ByteString::formatted("{:x}", U'a'), "61");
|
||||
EXPECT_EQ(ByteString::formatted("{:x}", U'\U0001F41E'), "1f41e");
|
||||
|
||||
EXPECT_EQ(ByteString::formatted("{:6}", L'a'), "a ");
|
||||
EXPECT_EQ(ByteString::formatted("{:6d}", L'a'), " 97");
|
||||
EXPECT_EQ(ByteString::formatted("{:#x}", L'\U0001F41E'), "0x1f41e");
|
||||
EXPECT_EQ(ByteString::formatted("{:d}", U'a'), "97");
|
||||
EXPECT_EQ(ByteString::formatted("{:d}", U'\U0001F41E'), "128030");
|
||||
|
||||
EXPECT_EQ(ByteString::formatted("{:6}", U'a'), "a ");
|
||||
EXPECT_EQ(ByteString::formatted("{:6d}", U'a'), " 97");
|
||||
EXPECT_EQ(ByteString::formatted("{:#x}", U'\U0001F41E'), "0x1f41e");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue